If $f : \mathbb{R} \to \mathbb{R}$ and $f(f(x))=x^2-x+1$, then find $f(2021)+f(1971)+f(50)$

207 Views Asked by At

I came across this question while solving a compendium of previous year questions of regional Mathematics Olympiads.
If $f : \mathbb{R} \to \mathbb{R}$ and $f(f(x))=x^2-x+1$, then find $f(2021)+f(1971)+f(50)$.

I have proceeded till finding out: $$f(0)=f(1)=1$$ $$f(1-x)=f(x)$$ I proceeded like this:$$f(f(f(x)))=(f(x))^2-f(x)+1$$ This implies that $f(f(f(1)))=(f(1))^2-f(1)+1$.
Now $f(f(1))=1$ therefore $f(1)=(f(1))^2-f(1)+1$ which is why $f(1)=1$.
Next I proved that $f(f(1-x)=f(x)$ using the fact that $$f(f(x)=(x-\dfrac{1}{2})^2+\dfrac{3}{4}$$ Then I proved that $f(x)$ is symmetric along $\dfrac{1}{2}$.
Next we put $x=\dfrac{1}{2}-x$ in the equations $f(\dfrac{1}{2}-x)=f(\dfrac{1}{2}+x)$ since it is valid for all values of x.
That is how I got $f(0)=f(1)=1$ and $f(1-x)=f(x)$.
But how do I proceed further to find the value of $f(2021)+f(1971)+f(50)$?