I am trying to solve the equation $z^n = 1.$
Taking $\log$ on both sides I get $n\log(z) = \log(1) = 0$.
$\implies$ $n = 0$ or $\log(z) = 0$
$\implies$ $n = 0$ or $z = 1$.
But I clearly missed out $(-1)^{\text{even numbers}}$ which is equal to $1$.
How do I solve this equation algebraically?