Shouldn't this be $g(x)$ in the middle.
@WALL-E I agree with you. There's a mapping from x to f(x) because x is independent variable, f(x) is a dependent variable. So the same logic here, g(x) is the independent variable, and f(g(x)) is dependent one, there should be a mapping from g(x) to f(g(x)).
Yes, this is just a typo. Thank you.