Form composite function $f(g(x))$ (#347)

Form composite function $f(g(x))$ (#347)

Substitute g(x)g(x) into f(x)f(x) and simplify.