The average density of the earth in terms of g (acceleration due to gravity), G (Universal gravitational constant) and R (Radius of earth) is
3g4πGR
We know g=GMR2 where g (acceleration due to gravity), M (mass of earth), G (Universal gravitational constant) and R (Radius of earth)
⇒M=g×R2G⇒ Density D = mass of earthvolume of earth=g×R2G×Ve
(Where Ve is the volume of the earth)
Ve = 43πR3
⇒D=g×R2G×43πR3=3g4πGR