01-04-2023

Problem: Let $f:\mathbb{R} \to \mathbb{R} $ be any function (need not be continuous) satisfying \[ f(f(x)) = x^2 -x + 1. \] Find out the value of $f(0) - f(1)$.

Solution: Note that \begin{equation}\label{eq:01Apr2023-1} f(f(0)) = 0^2 - 0 + 1 = 1. \end{equation} \begin{equation}\label{eq:01Apr2023-2} f(f(1)) = 1^2 - 1 + 1 = 1. \end{equation} We also have \begin{equation}\label{eq:01Apr2023-3} f(f(f(x))) = f(x)^2 - f(x) +1. \end{equation}


Using \eqref{eq:01Apr2023-2}, \eqref{eq:01Apr2023-3} we have \begin{align*} f(f(f(1))) = f(1) & \implies f(1)^2 - f(1) + 1 = f(1) \\ & \implies f(1)^2 - 2f(1) + 1 = 0\\ & \implies \left( f(1)-1 \right) ^2 = 0 \\ &\implies f(1) = 1. \end{align*} Therefore, using \eqref{eq:01Apr2023-1} and \eqref{eq:01Apr2023-3} we have \begin{align*} f(f(f(0))) = f(1) = 1 & \implies f(0)^2 - f(0) + 1 = 1 \\ & \implies f(0)^2 - f(0) = 0 \\ & \implies f(0) = 0,\text{ or }1. \end{align*} Note that if $f(0)=0$, then $f(f(0)) = f(0) = 0$, which is a contradiction. Hence, $f(0)=1$. Thus, \[ \textcolor{blue}{\boxed{f(0)-f(1) = 0}} \]