Find all $z$ such that $\left|\tan z\right| = 1$ 
Find all z such that $$\left|\tan z\right| = 1$$

The first thing that came to my mind was to write tangent in terms of $e^z$ and take its modulus, but I couldn't solve it in this way.
 A: Here is one way outlined:
1) Verify that (for $x\in\mathbf R$ and $y\in\mathbf R$)
$$
\overline{\tan(x+iy)}=\tan(x-iy)
$$
2) Make the following calculation
$$
|\tan(x+iy)|^2=\tan(x+iy)\tan(x-iy)=\cdots=\frac{-\cos 2x+\cosh 2y}{\cos2x+\cosh2y}.
$$
3) Conclude from the right-hand side (I leave that to you).
A: $$\tan z= \frac{\sin z}{\cos z}=\frac{e^{iz}-e^{-iz}}{i(e^{iz}+e^{-iz})}$$
So $$|\tan z|= \left|\frac{e^{iz}-e^{-iz}}{e^{iz}+e^{-iz}}\right|=1$$
$$\Rightarrow |e^{iz}+e^{-iz}|=|e^{iz}-e^{-iz}|$$
$$\Rightarrow |e^{2iz}+1|^2=|e^{2iz}-1|^2$$
$$\Rightarrow (e^{2iz}+1)\overline{(e^{2iz}+1)}=(e^{2iz}-1)\overline{(e^{2iz}-1)}$$
$$\Rightarrow (e^{2iz}+1){(e^{-2iz}+1)}=(e^{2iz}-1){(e^{-2iz}-1)}$$
$$\Rightarrow 1+e^{2iz}+e^{-2iz}+1=1-e^{2iz}-e^{-2iz}+1$$
$$\Rightarrow e^{2iz}+e^{-2iz}=0$$
$$\Rightarrow \cos(2z)+i\sin (2z)+\cos(2z)-i\sin (2z)=0$$
$$\Rightarrow \cos(2z)=0$$
So$$2z=n\pi+\frac{\pi}{2}$$
A: WLOG  let $\tan z=\tan(x+iy)=\cos A+i\sin A$ where $A,x,y$ are real
$\tan(x+iy+x-iy)=\cdots=\dfrac{2\cos A}{1-1}=0\implies2x=n\pi+\dfrac\pi2\  \  \ \ (1)$
$\tan\{x+iy-(x-iy)\}=\cdots=\dfrac{2i\sin A}{1+1}$
$\iff i\sin A=\tan(2iy)=i\tanh(2y)\iff\dfrac{e^{2y}-e^{-2y}}{e^{2y}+e^{-2y}}=\sin A$
Applying Componendo and Dividendo, $$e^{4y}=\dfrac{1+\sin A}{1-\sin A}$$
$$\implies4y=\ln\dfrac{1+\sin A}{1-\sin A}\  \  \ \ (2)$$
