If $g(x)$ is a polynomial, and $$g(x) = f(f(x))\ \forall x\in \mathbb{R}$$
is $f(x)$ necessarily a polynomial, given that $f$ is infinitely differentiable? Reading this question I noticed that the answer fails if we consider the domain to be the whole real line. I'm wondering whether removing the increasing condition allows for solutions that work across the whole real line, without allowing for "weird" functions like
$$f(x) = \left|x\right|^{\sqrt{2}}$$
hence the infinitely differentiable condition.
The only progress I've mad on this is as follows:
Assume $g(x)$ has degree $d$ and leading coefficient $a$. Thus
$$\lim_{x\to\infty} \frac{g(x)}{ax^d} = 1$$
$$\lim_{x\to\infty} \frac{f(f(x))}{ax^d} = 1$$
If
$$x^{k-\epsilon} << f(x) << x^{k+\epsilon}\ \forall\ \epsilon>0$$
for some $k$ (which I think has to hold), then
$$x^{k^2-\epsilon} << f(f(x)) << x^{k^2+\epsilon}$$
and thus $d=k^2$. I don't think this does much though. Does anyone have any ideas?