According to the information provided to define an average density, it is necessary to use the concepts related to mass calculation based on gravitational constants and radius, as well as the calculation of the volume of a sphere.
By definition we know that the mass of a body in this case of the earth is given as a function of
[tex]M = \frac{gr^2}{G}[/tex]
Where,
g= gravitational acceleration
G = Universal gravitational constant
r = radius (earth at this case)
All of this values we have,
[tex]g = 9.8m/s^2\\G = 6.67*10^{-11} m^3/kg*s^2\\r = 6378*10^3 m[/tex]
Replacing at this equation we have that
[tex]M = \frac{gr^2}{G} \\M = \frac{(9.8)(6378*10^3)^2}{6.67*10^{-11}} \\M = 5.972*10^{24}kg[/tex]
The Volume of a Sphere is equal to
[tex]V = \frac{4}{3}\pi r^3\\V = \frac{4}{3} \pi (6378*10^3)^3\\V = 1.08*10^{21}m^3[/tex]
Therefore using the relation between mass, volume and density we have that
[tex]\rho = \frac{m}{V}\\\rho = \frac{5.972*10^{24}}{1.08*10^{21}}\\\rho = 5.52*10^3kg/m^3[/tex]