When r<R

Solve[g 4 π r^2 4 π G Mr^3/R^3, g]

{{g (G M r)/R^3}}


Created by Mathematica  (June 17, 2004)