Find all complex numbers $z$ such as $z$ and $2/z$ have both real and imaginary part integers
Solution 1:
Recall that if a complex number $w$ has integral real and complex parts, then $|w|^2$ must be an integer.
Let's start by discussing the possible values of $|z|^2$. Note that $|z|^2$ is an integer, as is $|2z^{-1}|^2 = 4 / |z|^2$. Therefore, we see that $|z|^2$ is an integer factor of 4. This gives us 3 cases for $|z|^2$; it can either be 1, 2, or 4.
Suppose that $|z|^2 = 1$. The only possibilities are $z = \pm 1$ and $z = \pm i$, all of which work.
Now suppose that $|z|^2 = 2$. The only possibilities here are $z = \pm 1 \pm i$ (where the two $\pm$s are independent). A quick check shows that all of these possibilities work.
Finally, the last possibility is that $|z|^2 = 4$. The only possibilities here are $\pm 2$ and $\pm 2i$; again, a quick check shows that all of these work.
These are all the possibilities.
Solution 2:
If $z$ and $2/z$ both have real and imaginary parts that are integers, say $z=a+bi$ and $2/z=c+di$, then also $$(a^2+b^2)(c^2+d^2)=|z|^2\cdot\left|\frac{2}{z}\right|^2=4.$$ This leaves very few options for $a$, $b$, $c$ and $d$.