I came across a question which I though I managed to solve. After looking at the official solution for it I got very confused.
The Question
$H=\bigcup_{n=2}^\infty\{e^{\frac{2ik\pi}{n}}:0\leq k\leq n-1\}$ for $n\ge1$ how many elements of order $n$ does $H$ have?
My Thoughts
Since I know $e^{i\pi}=-1$, I concluded that $H=\{1, -1, i, -i\}$ and solved it like that.
The Expected Answer
Apparently $H$ is the group of all (or some) finite unity roots so the answer is $\phi(n)$ (Euler's identity)
What I don't understand
Is where are all the other members coming from? Am I wrong to think $H=\{1, -1, i, -i\}$? I would really appreciate some insights of this. Thanks
Edit: My thinking is that if every $h \in H$ is $(e^{\pi i})^\frac{2k}{n}$ for some $n,k$ and $e^{\pi i}=-1$ I assumed that every $h \in H$ is $(-1)^\frac{2k}{n}$ which can only be $1,-1,i,-i$
Reading the comments, it looks like you main source of confusion is the following line:
The main problem is that $\frac{2k}n$ is not necessarily an integer, so you can't conclude that $(-1)^{\frac{2k}n}$ is one of $1,-1,i,-i.$ It's not obvious for example what $(-1)^{\frac13}$ or $(-1)^{\frac14}$ is.
In fact that quantity isn't a-priori well-defined! For an integer $n,$ we would like $w = z^{1/n}$ to be the complex number such that $w^n=z.$ However for $1^{1/4}$ we have four candidates; $1,-1,i,-i.$ You might argue the natural choice is to take $w=1,$ but there isn't a natural choice for general $z.$
We usually define complex exponentiation by first defining,
$$ e^z = \sum_{n=0}^{\infty} \frac{z^n}{n!}. $$
We can also define $z^w = e^{w \log z},$ but this involves 'choosing a branch of the logarithm' since there is not natural choice for that, for similar reasons to above.
Subtle issues aside, for $x$ real we have the formula,
$$e^{ix} = \cos x + i \sin x$$
which you've hopefully seen before. Using this it should be clear that $H$ is a rather complicated group.