Well, similar suggestions - cases - are possible.
Assume f(x) = c, c constant. Then c = cg', g' = 1, and g = x + k, k constant.
Assume f(x) = x. Then x = gg', gdg = xdx, and (g^2)/2 = (x^2)/2 + k, k constant.
Assume f(x) = x^n. Then x^n = g^n g', g^n dg = x^n dx, [1/(n+1)]g^(n+1) = [1/(n+1)]x^(n+1) + k, k constant
Wow, that's an alright result. So for x to any power at all, it's possible. Is is true for any polynomial? Yes, it seems like it should be. So... for any polynomial, I believe you can use the above formula to reduce it.
f(x) = cos x, cos x = (cos g)g', (cos x)dx = (cos g)dg, sin(x) = sin(g) + k.
It seems like, unless I'm mistaken, this is the same thing every time:
f(x) = f(g(x))g'(x) is the same as solving the differential equation f(x)dx = f(g(x))dg.
So, as long as f is integrable, the problem is actually quite easy. Maybe I'm wrong. Thoughts?