TITLE: Functions whose derivatives can be written as a function of themself?
QUESTION [5 upvotes]: What kinds of function $f: \mathbb{R} \to \mathbb{R}$ can be written as some function of itself? I.e. $f'(x) = g(f(x))$ for some function $g$? 
If $f$ is given, can $g$ be solved in terms of the symbol $f$ (not in terms of specific $f$), if $g$ exists?
My question is related to part 3 of my another question, which asks about when the variance can be represented as a function of mean, both as functions of a distribution parameter, and in particular, when the variance is the derivative of the mean.
Thanks!

REPLY [2 votes]: I thought I would somehow find a way to prove $S=L \cup I$ but looking at Did's answer, I start doubting so I'll just post that for the time being and edit if I find something.

Let $S=\left\{f \in \mathcal C^1\left(\Bbb R, \Bbb R\right) \mid \exists g \in \mathcal F\left(\Bbb R,\Bbb R\right), \forall x \in \Bbb R, f'(x) = g(f(x))\right\}$
Let $A=\left\{x \mapsto ax+b \mid a,b \in \Bbb R\right\}$
Let $I=\left\{f\in C^1\left(\Bbb R, \Bbb R\right)\mid \forall x,y \in \Bbb R, f(x)=f(y) \implies x = y\right\}$

Let $f\in A$
$\forall x \in \Bbb R,f'(x)=k=k\Bbb 1(x)$
So we can take $g=k\Bbb 1$
So $f \in S$
$\boxed{A \subset S}$

Let $f\in I$
We can find $h:f\left(\Bbb R\right) \to \Bbb R$ so that
$\forall x \in \Bbb R, h(f(x))=x$
Then, we have that $f'(x)=f'(h(f(x))$ so we can take $g = f'\circ h$
So $f \in S$
$\boxed{I\subset S}$