Find $f(0)$ if $f(f(x))=x^2-x+1$
We have that $$f(f(0))=1$$ Then $$f(1)=f(f(f(0)))=f(0)^2-f(0)+1$$ On the other hand, $$f(f(1))=1$$ and hence, $$f(1)=f(f(f(1)))=f(1)^2-f(1)+1$$ And so we get that $f(1)=1$. Then $$f(0)^2-f(0)=0$$ So, $f(0)$ is $0$ or $1$.
Following a comment by @Calvin, $f(0)=0$ must be rejected.