Let $M$ and $R$ be the mass and radius of the Earth, respectively. If we assume that the Earth is a homogeneous sphere, then it has a constant density $\rho=\frac{3M}{4\pi R^3}$. For some radius $r<R$ from the centre of the Earth, all of the mass located at a radius greater than $r$ would not contribute anything to the gravitational field according to Newton's shell theorem. Therefore by Newton's law of gravity, the gravitational field at such an $r$ is $$\vec{g}=-\frac{GM_{enc}}{r^2}\hat{r}$$

Where $M_{enc}$ is the mass enclosed within the sphere of radius $r$.

$$M_{enc}=\rho\frac{4}{3}\pi r^3=M\frac{r^3}{R^3}$$ Finally

$$\vec{g}=-\frac{GM}{R^3}r\hat{r}$$

Which is proportional to $r$.