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(x^2-x+1) = f(f(f(x))) = f(x)^2-f(x)+1$$ This implies that $f(1) = f(1)^2-f(1)+1$ which is why $f(1)=1$.
Next I proved that $f(f(1-x))=f(f(x))$ using the fact that $$f(f(x))=\left(x-\frac{1}{2}\right)^2+\dfrac{3}{4}$$
Then I proved that $f(x)$ is symmetric along $\dfrac{1}{2}$.
Next we put $x\leftarrow\dfrac{1}{2}-x$ in the equations $f\left(\dfrac{1}{2}-x\right) = f\left(\dfrac{1}{2}+x\right)$ 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)$?