Proving that |z|=1. I am trying to prove that
If $z\in \mathbb{C}-\mathbb{R}$ such that $\frac{z^2+z+1}{z^2-z+1}\in \mathbb{R}$. Show that $|z|=1$.
1 method , through which I approached this problem is to assume $z=a+ib$ and to see that $$\frac{z^2+z+1}{z^2-z+1}=1+\frac{2z}{z^2-z+1}$$.
So problem reduces to show that $|z|=1$ whenever $\frac{2z}{z^2-z+1}\in \mathbb{R}$
I put $z=a+ib$ and then rationalise to get the imaginary part of $\frac{2z}{z^2-z+1}$ be $\frac{b-b^3-a^2b}{something}$. I equated this to zero and got my answer.
Is there any better method?

Let $w=\frac{z^2+z+1}{z^2-z+1}=1+\frac{2z}{z^2-z+1}$
Since $\frac{z^2+z+1}{z^2-z+1}\in \mathbb{R}$ , so $\operatorname{Im}(w)=0$
$$\iff w-\bar{w}=0$$
Now, let's solve $1+\frac{2z}{z^2-z+1}=\overline{1+\frac{2z}{z^2-z+1}}$
$$\implies \frac{z}{z^2-z+1}=\overline{\frac{z}{z^2-z+1}}$$
Since $z^2-z+1=0 \ when\ z= \frac{1 \pm i \sqrt{3}}{2}$ 
Assume $z \neq \frac{1 \pm i \sqrt{3}}{2}$
$$\implies \frac{z}{z^2-z+1}= \frac{\overline{z}}{\overline{z^2}-\overline{z}+1}$$
$$\implies z(\overline{z^2}-\overline{z}+1)=\overline{z}(z^2-z+1) $$
After some simplifications, we have 
$$ (z-\overline{z})(|z|-1)=0$$
$$\implies (z-\overline{z})=0 \ or \ |z|-1=0$$
Since $(z-\overline{z})=0\ $must be true by the above statement, so we just need to solve $|z|-1=0 \implies |z|=1$
