[Physics] Does the gravitational acceleration change value with height

atmospheric sciencehomework-and-exercisesnewtonian-gravity

My prof asked me to do a graphic of a given function and I have to just to vary the gravitational acceleration $g$ and the height $H$. If I know the interval in which $H$ is defined :$[500,2000]m$, how can I find the value of $g$?
Sorry for my English!

$$F = \frac{G\ M_e}{R_e^2}m = g\ m$$
at the surface of the earth $R_e$, then at other heights you can write (for $h << R_e$):
\begin{align} \\ F &= \frac{G\ M_e}{(R_e+h)^2}m\\ &= \frac{G\ M_e}{R_e^2(1+\frac{h}{R_e})^2}m\\ &\approx\frac{G\ M_e}{R_e^2}(1-2\frac{h}{R_e})m\tag1\\ &= g (1 - 2\frac{h}{R_e})\tag2\\ \end{align}
The trick at (1) is to use a first order expansion (the first term of the Taylor expansion) to show the relationship between the force of gravity at sea level and at greater heights. So you see it drops off linearly with height, and the coefficient of the slope is twice the ratio of the height to the radius of the earth. Now you don't need tons of significant figures to calculate the drop with height - because you can take the $g$ term out altogether and draw the sketch: