Inside the Earth, the gravitational force varies linearly with distance $r$ from the center due to the shell theorem.
The force is given by: $\vec{F} = \dfrac{GMm}{R^3} r \ \hat{r}$
Here, $M$ is the mass of Earth, $R$ is the radius of Earth, and $r$ is the distance from the center. The direction is radial, hence $\hat{r}$.