If $ \frac {z^2 + z+ 1} {z^2 -z +1}$ is purely real then $|z|=$? If z is a complex number and $ \frac {z^2 + z+ 1} {z^2 -z +1}$   is purely  real then find the value of $|z|$ .
I tried to put $ \frac {z^2 + z+ 1} {z^2 -z +1} =k $ then solve for $z$ and tried to find |z|, but it gets messy and I am stuck.
The answer given is |z|=1

Suppose $|z|=r$, so that $z\bar{z}=r^2$ or $\bar{z}=r^2/z$.
We have that $$\overline{\frac{z^2+z+1}{z^2-z+1}}=\frac{\bar{z}^2+\bar{z}+1}{\bar{z}^2-\bar{z}+1}=\frac{r^4/z^2+r^2/z+1}{r^4/z^2-r^2/z+1}=\frac{z^2+r^2 z+r^4}{z^2-r^2z+r^4}. $$
But if the expression $$ \frac{z^2+z+1}{z^2-z+1}$$ is real, we must have
$$\overline{\frac{z^2+z+1}{z^2-z+1}}=\frac{z^2+z+1}{z^2-z+1}. $$
This should help you determining $r=|z|$.
