Since $z^5 = 1,$ $z^5 - 1 = 0,$ which factors as
\[(z - 1)(z^4 + z^3 + z^2 + z + 1) = 0.\]Since $z \neq 1,$ $z^4 + z^3 + z^2 + z + 1 = 0.$

Then
\[z + \frac{1}{z} + z^2 + \frac{1}{z^2} = \frac{z^3 + z + z^4 + 1}{z^2} = \frac{-z^2}{z^2} = \boxed{-1}.\]
Question:
Let $z$ be a complex number such that $z^5 = 1$ and $z \neq 1.$  Compute
\[z + \frac{1}{z} + z^2 + \frac{1}{z^2}.\]
Answer:
Let's think step by step.

user
-1
Let $z$ be a complex number such that $z^5 = 1$ and $z \neq 1.$  Compute
\[z + \frac{1}{z} + z^2 + \frac{1}{z^2}.\]
test