As noted in a comment, the most straightforward approach is through Gauss's law. The force on a body outside a spherical shell is the same as if the shell were concentrated at the centre, and the force on a body inside a spherical shell vanishes. Thus, at a distance $x$ from the centre of a sphere of radius $r\ge x$ and mass $m_1$, a body of mass $m_2$ experiences a force
$$ G\frac{\left(\frac{x^3}{r^3}m_1\right)m_2}{x^2}=Gm_1m_2\frac x{r^3}\;, $$
that is, the force increases linearly with the distance from the centre.