Functional equation question involving fixed points Let $g(x)$ be a quadratic function such that the equation $g(g(x)) = x$ has at least
three different real roots. Then there is no function $f : R → R$ such that
$f ( f (x)) = g(x)$
for all $x ∈ R$.
Well i would love to show you my attempts, except i have no clue what to do. My first thought however was $Q(x)=g(g(x))$ and then Q has atleast 3 fixed points and its degree is 4. But since m not that well versed in usage of fixed points ( For the record: i haven't ever solved a single question using fixed points lol) i don't really know how to proceed. This question really does remind of IMO 2006 P5 :
Let $P(x)$ be a polynomial of degree $n > 1$ with integer coefficients and let $k$ be a positive
integer. Consider the polynomial $Q(x) = P(P(. . . P(P(x)). . .))$, where $P$ occurs $k$ times. Prove that there are at most n integers t such that $Q(t) = t$.
Well its kinda similar ( not too much but yeah this was the first thing that came to mind). It would be fantastic if i could get solutions to both which are easy to understand for someone not amazingly well-versed with the theorems and lemmas (Please use as many of them as you like just add the statement so i can learn some new lemmas and theorems!) Thanks a ton!
 A: I'm just going to do the first one. If you want another question answered, make a new post for it.
Let $g(x)$ be a quadratic function such that the equation $g(g(x)) = x$ has at least
three different real roots. Let's call them $a$, $b$, and $c$.
These are all points of period 2 for $g(x)$, so they are either fixed points of $g$, or else they have minimal period 2, which means $g$ exchanges them in pairs.
Since $g(x) - x$ is a quadratic polynomial, it has at most 2 roots, so $g$ has at most 2 fixed points. So, without loss of generality, $a$ is a point of minimal period 2. But then so is $g(a)$, which without loss of generality, we can take to be $c$. So $g(a) = c$ and $g(c) = a$.
Now suppose there is a function $f : \mathbb{R} → \mathbb{R}$ such that
$f ( f (x)) = g(x)$
for all $x \in \mathbb{R}$.
Now, $f^{4}(a) = g^{2}(a) = a$, so $a$ is a point of period 4 for $f$, and it isn't a point of period 2 for $f$ since it's not a fixed point of $g$. It also can't be period 3, since if $f^{3}(a) = a$, then $a = f^{4}(a) = f(a)$, which we already ruled out. Thus, $a$ is a point of minimal period 4 for $f$. This means that as you apply $f$, it cycles through 4 points $a$, $f(a)$, $c$, $f(c)$, $a, \dotsc$. Since the other two points are also distinct points of minimal period 2 of $g$, without loss of generality, we can let $f(a) = b$, and $f(c) = d$.
Thus, we have that $f$ cycles $a, b, c, d$ and $g$ cycles $a,c$ and $b,d$. In particular, all 4 distinct points are roots of $g^{2}(x) - x$, but since this is a quartic polynomial, these are the only such roots. In particular, $g$ can't have any fixed points.
But $g(x) - x$ is a continuous function, and is positive for the smaller of $a$ and $c$, and negative for the larger. By the Intermediate Value Theorem, it must have a root, i.e., a fixed point of $g$. This is a contradiction, and so no such $f$ can exist.
