Daniel B. answered 03/26/21
A retired computer professional to teach math, physics
Sometimes it becomes clearer if we use a different variable name for f:
f(u) = u3 - u
In that equation replace all occurrences of "u" with "g(x)"
f(g(x)) = (g(x))3 - g(x) = (2x-2)3 - (2x-2)
You can rewrite that expression in a different format, if so desired.