Solve a system of functional equations


Find all functions $f:mathbb Rtomathbb R$ such that for all $xinmathbb R$, $f(xf(x))=f(x)^2$ & $f(f(x))=x$.

Evaluating at zero, $f(0)=f(0)^2$ and $f(f(0))=0$.
Evaluating at one, $f(f(1))=f(1)^2$ and $f(f(1))=1$.

So $f(1)=pm 1$ and $f(0)=frac 12pmfrac 12$. But I can’t find more information.