If $\space$ $\forall$ $x \in \Bbb R$, $\space$ $f(f(x))=x^2-x+1$. Find the value of $f(0)$. If $\space$ $\forall$ $x \in \Bbb R$, $\space$ $f(f(x))=x^2-x+1$. Find the value of $f(0)$.
I thought that making $f(x)=0$ implies that $f(0)= 0^2 - 0 + 1 = 1$, but i think that this isn't correct, because the $x$ in $f(f(x))$ isn't equal to $f(x)$ .
Any hints?

We first consider $f(1)$. Note that $f(f(1)) = 1$, so by substituting $x=f(1)$ we obtain $f(1) = f(f(f(1))) = f(1)^2 - f(1) + 1$. We therefore obtain the quadratic equation $f(1)^2 - 2f(1) + 1 = 0$ which implies $f(1) = 1$. 
Also note that $f(f(0)) = 1$, so we have $f(1) = f(f(f(0))) = f(0)^2 - f(0) + 1$. So we obtain $f(0)^2 - f(0) = 0$ giving $f(0) = 0$ or $f(0) = 1$. Note that if $f(0) = 0$ then $f(f(0)) = f(0) = 0 \neq 1$, yielding a contradiction, so we conclude $f(0) = 1$.
