(2). Determine the velocity which a body released at a

distance r from the center of the
earth when it strikes the earth surface.

I assume that you are doing this a significant r>>Re so that you can not assume a constant g.

It is easiest to do this with potential energy ---> kinetic energy
define
potential energy zero at infinity
that way it is always negative, the more negative the faster. That avoids the problem of everything undefined when r = 0

Potential energy at r U= -m GMe/r
at Re this is-m GMe/Re
the change in U going from r to Re is what we want
UatRe -Uat r =-m GMe/Re-(-m GMe/r)
so LOSS of U in the fall =
m GMe(1/Re - 1/r)
so
(1/2)m v^2 = G m Me(1/Re - 1/r)
or
v^2 = 2 G Me (r -Re)/(r Re)

note:
if r is close to Re
v^2 = 2 G Me height/Re^2
and we call GMe/Re^2 just g