The key point to solve this problem is you should know the material on a spherical shell has no gravitational effect inside the shell. So to calcite the gravitational acceleration, you just need to consider the contribution from mass inside the $4000km$ sphere.
I think you should already know how to calculate the gravitational acceleration of a planet has constant density:
$Gravitation Force = Gm\frac{\iiint\rho(r‘)dV}{r^2}$
where $r$ is the distance of object $m$ from the center of planet, and $\rho(r')$ is the density of planet, it's a function of $r'$ (as in your problem). We know the gravitation force on the object $m$ is $Force = ma$, so the acceleration is
$a = G\frac{\iiint\rho(r‘)dV}{r^2} = G\frac{4\pi\int\rho(r')r'^2dr'}{r^2}$
In your case, $r = 4000km$, using the conclusion stated in my first paragraph, and the density stated in your problem, we should have this:
$\iiint \rho(r')dV = 4\pi\int\rho(r')r'^2dr' = 4\pi(\int_0^{2000km}\rho_1r'^2dr' + \int_{2000km}^{4000km}\rho_2r'^2dr')$
where $\rho_1 = 8kg/L$ and $\rho_2 = 4kg/L$ as stated in your problem.
Also, there is a simple way to do this problem. Since the density here $\rho_1$ is twice of $\rho_2$, so you can think like this: the gravitational force of this single planet can be effectively equal to a total effect of two planets have same densities, but one planet only has $2000km$ radius, and the other has $4000km$ radius, so calculate the acceleration of both planets at the radius of $4000km$, and then combine these two to get the total acceleration.