Functional equation - unique solution A twice differentiable function $f:\mathbb{R} \to \mathbb{R}$ is given such thah $f(0) = 1$, $f(\mathbb{R}) = \mathbb{R}$ and $f(f(x)) = 4x - 1$ for all $x \in \mathbb{R}$. One such function is $f(x) = -2x + 1$. I wonder if there is another function satisfying the given equation and conditions. Can anyone help?
 A: The solution is in the comments. I'll just put them together.
$f^2$ is injective. From that it's easy to show that $f$ is also injective. $f(1)=f(f(0))=-1<f(0)$, this along with being injective says that $f$ is strictly decreasing. Since $f$ is differentiable it follows that  for all x
\begin{equation}
f'(x) \leq 0  \hspace{4cm} (1)
\end{equation}
Now differentiating $f(f(x))=4x-1$ with respect to $x$
\begin{equation}
f'(f(x))f'(x)=4  \hspace{2.6cm} (2)
\end{equation}
Replacing $x$ with $f(x)$ in $(2)$ we get
\begin{equation}
f'(4x-1)f'(f(x))=4  \hspace{1.7cm} (3)
\end{equation}
From $(2)$ and $(3)$ one get $f'(x)=f'(4x-1)$ where again substituting $x$ by $\frac{x+1}{4}$ we get
\begin{align}
 f'(x)&=f'(\frac{x}{4}+\frac{1}{4}) \\
      &=f'(\frac{x}{4^2}+\frac{1}{4^2}+\frac{1}{4}) \\
      &=f'(\frac{x}{4^3}+\frac{1}{4^3}+\frac{1}{4^2}+\frac{1}{4}) \\
      &= \cdots ~~\cdots ~~\cdots \\
      &=f'(\frac{x}{4^n}+\sum_{i=1}^n \frac{1}{4^i})~~~~~~~~~~~(\textit{after the}~n^{th}\textit{th}~\textit{equality})
\end{align}
Now taking limit as $n \rightarrow \infty$, since $f'$ is continuous we obtain for all $x$ that $f'(x)=f'(\frac{1}{3})=a'$ $\hspace{0.5cm}$ (say). This implies (by integrating) $f(x)=a'x+b'$  for some real constant $b'$. From $(1)~~~f'(x) \leq 0$ and  $f(0)=1$ implies $a' \leq 0$ and $b'=1$. $a'=0$ is not an option since we have $f^2(x)=4x-1$. Let $a'=-a$ where $a>0$. Then $f(x)=-ax+1$. Now $f(f(x))=4x-1$ gives (equating coefficient of $x$ and the constant term) $a=2$.  So $f(x)=-2x+1$ is the unique function with the said properties.
