g(x) is a function defined by the expression on the right-hand side of the equals.
g(x) tells us what to do when we are given a value for x. Therefore, we don't "solve" for g, we actually evaluate g by substituting -2 for x in the expression that defines the function g. This is usually expressed as g(-2) if we are calculating the expression when x=-2.
g(-2)=(-2)3+9=-8+9=1, making g(-2)=1.