# Functional equation: composition to get quadratic

Consider the following functional equation: $$f(f(x))=x^2+x-7\quad\quad\forall\; x\in\mathbb{R}.$$ Does there exist a function $$f:\mathbb{R}\to\mathbb{R}$$ satisfying this, or not?

• This puzzle may be a bit too hard. If it goes unsolved for a while, I'll add a hint. – Rand al'Thor Feb 5 at 14:09
• rot13(Guvf cqs fubhyq or bs uryc: uggc://lnebfyniio.pbz/cncref/evpr-jura.cqs) – user Feb 5 at 14:33
• @user Oh interesting! That solves the problem for sure, but it can be done (at least in this case) without using all of that complex machinery. – Rand al'Thor Feb 5 at 14:36
• If $x = 0$, we have the property $f(f(0)) = -7$. Wonder if that helps? – new QOpenGLWidget Feb 5 at 15:13
• Ah, but while the main theorem proved in the article is about functions C -> C, the last section comments briefly on the R->R situation and there's a theorem there that resolves this problem. – Gareth McCaughan Feb 5 at 17:41

Let's look at fixed points. And let's write $$f^2(x)$$ for $$f(f(x))$$.
$$f^2(x)=x$$ has two fixed points: $$\pm\sqrt 7$$. These are also fixed points of $$f^4(x)$$, together with $$-1\pm\sqrt 6$$, which are swapped by $$f^2(x)$$.
As $$f$$ maps any fixed point of $$f^n$$ to a fixed point of $$f^n$$, $$f$$ restricted to the four points $$\pm\sqrt 7,-1\pm\sqrt 6$$ is a permutation. $$f^2$$ being a square must be even but we have just seen that $$f^2$$ is an elementary permutation, hence odd. Contradiction.