TITLE: $f'(x) = g(f(x)) $ where $g: \mathbb{R} \rightarrow \mathbb{R}$ is smooth. Show $f$ is smooth.
QUESTION [7 upvotes]: Suppose $f: \mathbb{R} \rightarrow \mathbb{R} $ is differentiable and $g: \mathbb{R} \rightarrow \mathbb{R} $ is infinitely differentiable, i.e. $ g \in C^{\infty}(\mathbb{R})$, where we know $f'(x) = g(f(x)) $ on $\mathbb{R}$. Show that $ f \in C^{\infty}(\mathbb{R})$.

Thus I have to show that $f$ is infinitely differentiable, that is, derivatives of all orders exist. I can assume by induction that all derivatives of order less than, say $n$, exist, and have to show that the $nth$ derivative exists for $f$. 
I came up with this:
$f^{n}(x) = (g \circ  f)^{n-1}(x)$. I somehow have to show that the $(n-1)th$ derivative for this composite function exists. I tried using the chain rule, but it just seems to become more ugly as I continue taking more derivatives. Obviously, I have to use the fact that $g$ is infinitely differentiable as well as the inductive assumption, although I'm not sure how to complete this line of reasoning. Maybe induction isn't even the right way to proceed. 
Ideas?

REPLY [2 votes]: Note that this is a differential equation. The equivalent Picard integral equation is
$$
f(x)=f(0)+\int_0^x g(f(t))\,dt
$$
From here it is trivial to observe that if $f$ is $C^n$ or better, then the composition $g\circ f$ is also at least $C^n$ and thus the anti-derivative $C^{n+1}$. Which gives that $f$ is also $C^{n+1}$ and so on.