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?
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.$$