Are there functions $f,g:\mathbb{R} \to \mathbb{R}$ such that they differentiate each other?

i.e. $$f'(x) = (g \circ f)(x)$$ $$g'(x) = (f\circ g)(x)$$

I came up with this question a few years ago. A friend found the only example I know:

for $c\in\mathbb{R}$ $$f(x) = c$$ $$g(x) = cx - c^2 $$

After trying with some particular cases (with no success), I used the formula for the derivative of the inverse function and got that if $f$ and $g$ are bijective then,

$$f^{-1} = \int{}{dt \over g(t)} $$ $$g^{-1} = \int {dt \over f(t)}$$

Assuming all conditions neccesary for this to be possible. I tried using this fact to construct the functions, again with no luck.

I would really appreciate any insight on how to tackle this problem.


Some partial results, but too long for a comment.

The condition implies that $f,g$ are $C^\infty$. In particular, $$ f''=(g\circ f)'=f'\cdot g'\circ f=g\circ f \cdot f\circ g\circ f=(\operatorname{id}\cdot f)\circ g\circ f$$ so that every zero of $f'$ is also a zero of $f''$. Let $h_0=f$ and recursively $$h_{n+1}=\begin{cases}g\circ h_n&n\text{ even}\\f\circ h_n&n\text{ odd}\end{cases}$$ So far, we have $f=h_0$, $f'=h_1$, $f''=h_1h_2$. Note that $$h_{n+1}'=\begin{cases}h_n'\cdot g'\circ h_n=h_n'\cdot f\circ g\circ h_n&n\text{ even}\\ h_n'\cdot f'\circ h_n=h_n'\cdot g\circ f\circ h_n&n\text { odd}\end{cases} $$ So at any rate, $$ h_{n+1}'=h_n'h_{n+2}.$$ Thus by induction, $$\tag1 h_n'=\prod_{k=1}^{n+1} h_k.$$

Let $$ H=\Bigl\{\,\prod_{k=1}^m h_k^{a_k}\Bigm| m\ge 1, a_1\ge a_2\ge a_m\ge1 \,\Bigr\}$$

If $\phi\in H$, then by the product rule and $(1)$, $\phi'$ is a finite sum of elements of $H$. As $f'=h_1\in H$, we conclude that all $f^{(n)}$, $n\ge1$, are finite sums of elements of $ H$. In particular, for all $x$ with $f'(x)=0$, we have $f^ {(n)}(x)=0$ for all $n\ge1$. The same conclusion of course holds for $g$.

As a consequence of the identity theorem:

If $f$ is analytic, then $f$ is either constant (and so $g$ linear) or $f'$ has no zeroes (so in particular, $f$ is strictly monotonic). Same for $g$.

So if $f,g$ are analytic and neither is constant, then both are monotonic, hence all $h_n$ are strictly monotonic. If both $f,g$ are increasing, then all derivatives are increasing.