Acceleration due to gravity at depth $d$ from the surface of earth $g^{\prime}=g\left(1-\frac{d}{\mathrm{R}}\right)=g\left(\frac{\mathrm{R}-d}{\mathrm{R}}\right)$
Let $\mathrm{R}-d=y$,
$g^{\prime}=\frac{g y}{R}$
Force on a body of mass $m$ at point $P$,
$\mathrm{F}=-m g^{\prime}$ (force is considered negative
$\mathrm{F}=-\frac{m g}{\mathrm{R}} \cdot y \quad \ldots$ (1) toward the centre)
$\therefore \mathrm{F} \propto-y$

