Multiplying the equation $z^4 + z^2 + 1 = 0$ by $z^2 - 1 = (z - 1)(z + 1)$, we get $z^6 - 1 = 0$.  Therefore, every root of $z^4 + z^2 + 1 = 0$ is a sixth root of unity.

The sixth roots of unity are $e^{0}$, $e^{2 \pi i/6}$, $e^{4 \pi i/6}$, $e^{6 \pi i/6}$, $e^{8 \pi i/6}$, and $e^{10 \pi i/6}$.  We see that $e^{0} = 1$ and $e^{6 \pi i/6} = e^{\pi i} = -1$, so the roots of
\[z^4 + z^2 + 1 = 0\]are the remaining sixth roots of unity, namely $e^{2 \pi i/6}$, $e^{4 \pi i/6}$, $e^{8 \pi i/6}$, and $e^{10 \pi i/6}$.  The complex number $e^{2 \pi i/6}$ is a primitive sixth root of unity, so by definition, the smallest positive integer $n$ such that $(e^{2 \pi i/6})^n = 1$ is 6.  Therefore, the smallest possible value of $n$ is $\boxed{6}$.
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
What is the smallest positive integer $n$ such that all the roots of $z^4 + z^2 + 1 = 0$ are $n^{\text{th}}$ roots of unity?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
6
What is the smallest positive integer $n$ such that all the roots of $z^4 + z^2 + 1 = 0$ are $n^{\text{th}}$ roots of unity?
test