I am having difficulty with calculating the same answer given.

g(x)=sqrt(|x|).

huh? just plug in values for x.

take a look at the definition of |x|
g(x) = √x if x >= 0
g(x) = √(-x) if x < 0

Note that √4 = 2, not ±2
you always take the positive value
just because (-2)^2 = 4 does not mean that -2 = √4