$$For scientist B,$$
Since, $$ g \propto \dfrac{1}{r^2} $$
So, as the distance from the center of earth increases, the value of g decreases.
$$For scientist A,$$
Let scientist A be at a depth $$d$$.
Then only attraction is due to the sphere $$ (R – d) $$ , where $$ R $$ is the radius of earth.
As the attraction due to rest of the earth cancels out, so the value of $$ g$$ decreases.