Here is how I tried solving this problem:
$\cos{z} = \frac{e^{iz}+e^{-iz}}{2} = -2 \Leftrightarrow e^{iz}+e^{-iz} = -4$
Multiply by $e^{iz}$:
$e^{2iz} + 1 = -4e^{iz} \Leftrightarrow e^{2iz}+4e^{iz} + 1 = 0$
Substitute $e^{iz}$ with $x$ and solve for $x$:
$x^2 - 4x + 1 = 0 \Rightarrow x = 2 \pm\sqrt{3}$
Substitute back and solve for $z$:
$e^{iz} = 2\pm\sqrt{3} \Leftrightarrow iz = 2\pi ni + \log(2\pm\sqrt{3}) \Leftrightarrow z = 2\pi n -i\log(2\pm\sqrt{3})$
Answer: $z = 2\pi n -i\log(2\pm\sqrt{3})$ (for $n\in\mathbb{Z}$)
Now I am unsure about the period, some resources say that it should be $2\pi n$, and some say it should be $2\pi n + \pi$. How do I know? I did this how I have learned to do it, but am I doing it wrong?