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?
 A: We are given that the imaginary part of $\frac{z^2+z+1}{z^2-z+1}$ is zero.
Therefore $\frac{z^2+z+1}{z^2-z+1}$ is equal to its own conjugate:
$$\frac{z^2+z+1}{z^2-z+1} = \frac{\bar z^2+\bar z+1}{\bar z^2-\bar z+1}.$$
Cross-multiply (multiply both sides by $(z^2-z+1)(\bar z^2-\bar z+1)$)
and cancel all terms on the right. The result is
$$ 2z\bar z^2 - 2z^2\bar z - 2\bar z + 2z = 0,$$
which you can simplify to
$$(\bar z - z)z\bar z - \bar z + z = 0.$$
Since the imaginary part of $z$ is not zero,
it follows that $\bar z - z \neq 0$ and you can divide both sides of the equation
by $\bar z - z$ to obtain
$$ z\bar z - 1 = 0.$$
A: 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$
