Let $f:\mathbb R\to\mathbb R$ be a smooth, orientation preserving diffeomorphism of the real line.  

Is it the case that there always exist another diffeomorphism $g:\mathbb R\to\mathbb R$
such that $g\circ g = f$?


*Note:* it is relatively easy to show that a continuous $g$ exists, but I am not managing to find a smooth (i.e. $\mathcal C^\infty$) solution of the above equation.



square root of diffeomorphism of R: does it always exist?
The answer is no, assuming that you seek an orientation preserving square root.


(I see unknown's answer appeared while I'm typing. I don't quite understand it at the moment but the construction looks different.)


Consider a diffeomorphism $f$ such that $f(0)=0$, $f(1)=1$, $f(t)>t$ for all $t\in(0,1)$, $f'(0)=a>1$, $f'(1)=b<1$ and furthermore $f$ is linear in a neighborhood of 0 and in a neighborhood of 1. Let $g$ be a $C^1$ square root of $f$. Then obviously $g(0)=0$, $g'(0)=\sqrt a$ and moreover $g(t)=\sqrt a\cdot t$ in the neighborhood of 0 where $f^{-1}$ is linear. Indeed, suppose that $g(t\_0)=ct\_0$ where $c\ne\sqrt a$, then
$$
 g(a^{-k}t\_0) = g(f^{-k}(t\_0)) = f^{-k}(g(t\_0)) = ca^{-k}t\_0 .
$$
Since $g(0)=0$ and $g(a^{-k}t\_0)=ca^{-k}t\_0$, there exist a point $t$ between $0$ and $a^{-k}(t\_0)$ (and hence arbitrarily close to 0) such that $g'(t)=c$, contrary to continuity of $g'$ at 0.


Similarly, $g(1)=1$, $g'(1)=\sqrt b$ and $g$ is linear near 1: $g(t)=1+\sqrt b(t-1)$. So we know $g$ near the endpoints. Furthermore there is a compatibility condition: take $t\_0$ close to 0 and a very large $n$ such that $f^n(t\_0)$ is close to 1. Then 
$$
f^n(\sqrt a t\_0) = f^n(g(t\_0)) = g(f^n(t\_0)) = 1+ \sqrt b(f^n(t\_0)-1)
$$
Obviously a generic $f$ does not satisfy this (and hence doest not have a square root), since the $f$-orbits of $t\_0$ and $\sqrt a t\_0$ are essentially independent.


More formally, modify $f$ near some point $t'=g^{2k+1}(t\_0)$ which is far from 0 and 1, so that the resulting function $\tilde f$ equals $f$ outside the segment $[f^{k}(t\_0),f^{k+1}(t\_0)] = [g^{2k}(t\_0),g^{2k+2}(t\_0)]$ and $\tilde f(t')\ne f(t')$. The new function satisfies $\tilde f^n(t\_0)=f^n(t\_0)$ but
$$
 \tilde f^n(\sqrt a t\_0) \ne f^n(\sqrt a t\_0) = 1+ \sqrt b(\tilde f^n(t\_0)-1) ,
$$
hence $\tilde f$ cannot have a $C^1$ square root.


A similar argument shows that diffeomorphisms without square root are dense among diffeomorphisms with at least two fixed points.


EDIT: If $f$ has exactly two fixed points, then it does not have an orientation reversing square root as well. Because such a square root $g$ would have exactly one fixed point, and all other fixed points of $g^2$ come in pairs of the form $\{t,g(t)\}$. So $g^2$ must have an odd number of (or infinitely many) fixed points.


