For the STEP 3 complex numbers assignment q1 part 2:
$x^4+1=0\\
x^4=-1\\
x=e^{i\frac{\pi}{4}},e^{i\frac{3\pi}{4}},e^{-i\frac{\pi}{4}},e^{-i\frac{3\pi}{4}}\\$
We know all the solutions satisfy $x^n=1$, so taking one of them:
$(e^{i\frac{\pi}{4}})^n=1\\
e^{i\frac{n\pi}{4}}=1\\
\frac{n\pi}{4}=2k\pi\\
n=8k\\$
For k being an integer. As they are all primitive roots, we want smallest k where n is a positive integer, so taking $k=1$, we get $n=8$.
If you use the $e^{i\frac{3\pi}{4}}$ solution instead we get: