Answer
See answers.
Work Step by Step
a. The density is the total mass divided by the total volume. Let subscript 1 represent the inner core, subscript 2 represent the outer core, and subscript 3 represent the mantle. The radii are the outer radii.
$$V_1=\frac{4\pi}{3}r_1^3$$
$$M_1=\rho_1 V_1$$
$$V_2=\frac{4\pi}{3}(r_2^2-r_1^2)$$
$$M_2=\rho_2 V_2$$
$$V_3=\frac{4\pi}{3}(r_3^2-r_2^2)$$
$$M_3=\rho_3 V_3$$
$$\rho_{3\;layers}=\frac{M_1+M_2+M_3}{V_1+V_2+V_3}=5500\;kg/m^3$$
b. The actual density is the mass divided by the volume.
$$\rho_{actual}=\frac{5.98\times10^{24}kg}{\frac{4\pi}{3}(6380000\;m)^3}\approx 5500\;kg/m^3$$
A more accurate accounting shows that the 3-layer model overestimates the actual density by about 0.07 percent.