I assume that's a formula you've been given, so it's obvious how to use the latitude and altitude in computing g. That leaves me not knowing what you're asking. Are you puzzled as to how the formula can be valid?
When asked to compute an uncertainty in f=f(x,y,..), given the uncertainties in x, y..., there are two principal methods producing different answers: absolute uncertainty and statistical uncertainty. The first is appropriate when the given uncertainties are absolute uncertainties with uniform distributions (as often is the case with instrumental measurements), there are only two or three parameters, and the answer is to be relied on absolutely, as may be the case in structural engineering. In this method, just plug in all the combinations of extreme values for the parameters and see what f values come out.
For statitical uncertainty you assume the given uncertainties are some number of standard deviations, the same number in each parameter, or otherwise convert to that form. You may then be able to use a root-sum-square formula to combine them, and the answer will represent the same number of standard deviations for f.
E.g. if f=x*y, Δf = xΔy+yΔx; E[(Δf)2] = E[x2]Δy2+E[y2]Δx2; σ(f)/f = √((σ(x)/x)2+(σ(y)/y)2).
More generally, Δf = (∂f/∂x)Δx+(∂f/∂y)Δy, etc.