If the change in the value of g at a height h above the surface of the earth is the same as at a depth x below it when both x and h are much smaller than the radius of the earth, then
Since value of g at height h and at depth x is equal, we have
g[R2(R+h)2]=g[r−xR]
or, R2(R+h)2=R−xR
or, R3=(R−x)(R+h)2
=(R−x)(R2+2Rh+h2)
or, 2R2h+Rh2−xR2−2Rhx−xh2=0
or, R(2Rh−xR−2hx)=0
Considering h and x very small, we have
x=2h