Method of solving the functional equation $f(2x)=f(x)$ using Lagrange's Mean Value Theorem A problem i have goes as follows:

Let $f:\mathbb R\to\mathbb R$ be a continuous function satisfying $f(2x)=f(x),\;\forall\;x\in\mathbb R$. If $f(1)=3$, then the value of $\displaystyle \int_{-1}^1 f(f(f(x)))\,\mathrm dx$ is?

Now, their solution is as follows.

Consider $f(x)$ on the interval $[x_0,2x_0]$. Then:
  $$\dfrac{f(2x_0)-f(x_0)}{x_0}=f'(c),\text{    where }c\in(x_0,2x_0)$$
  $$\therefore f'(c)=0$$
  $$\therefore \color{red}{f(x)=\text{a constant}}$$
  $$\vdots$$

How did they get to the step highlighted in red from the previous step? The function derivative is zero at some $x=c$, how does it imply that the function derivative is zero on the entire function?
Also, is there another method to solve the functional equation?
Thanks!

The red claim is true, but a non sequitur as stated. For example, there seems to be an application of Rolle's theorem, but the we do not even knwo if the premises hold. Also, one could (immediately) only conclude that some points have derivative zero.
However:
The continuous function $f$ restricted to the compact interval $[1,2]$ attains its maximum $M$ and its minimum $m$. Then $M$ and $m$ are also attained in every interval $[2^{-k},2^{1-k}]$. By continuity, $f(0)=M=m$. We conclude that $f$ is constant (as the same argument works for negative $x$).
