How many elements set $\{\cos(\frac{2\pi k}{n})| k \in \mathbb Z\}$ has, $n \in \mathbb N$ How many elements set $\{\cos(\frac{2\pi k}{n})| k \in \mathbb Z\}$ has if $n \in \mathbb N$. 
My attempt 
The idea is to split $\mathbb Z$ in $m\in \mathbb N$ disjunctive subsets $U_i$, such that $\forall k \in U_i, \forall l \in U_j, \cos(\frac{2\pi k}{n})\ne \cos(\frac{2\pi l}{n})$ if $j\ne i$ and $\cos(\frac{2\pi k}{n})= \cos(\frac{2\pi l}{n})$ if $j = i$. Then $m$ is the number of elements in my set. 
Next I reason that $$\cos(\frac{2\pi k}{n})- \cos(\frac{2\pi l}{n})=2\sin(\frac{\pi (k-l)}{n})\sin(\frac{\pi (k+l)}{n})=0 \iff k + l = n z \lor k - l = n z, z \in \mathbb Z$$
Now I consider relation $R$ on $\mathbb Z$
$$ (k,l) \in R :\iff k + l = n z \lor k - l = n z, z \in \mathbb Z$$
This relation is reflexive, symmetric and transitive, so it is an equivalence relation and its equivalence classes are exactly the subsets I am looking for. 
I note that $[k]=\{l \in \mathbb Z : k + l = n z \lor k - l = n z, z \in \mathbb Z\}=(-k+n \mathbb Z)\bigcup(k+n \mathbb Z)$.
So we can define a surjective function $f: \{k+n \mathbb Z : k \in \mathbb Z\} \to \{[k]:k\in \mathbb Z\} , (k+n \mathbb Z) \mapsto (-k+n \mathbb Z)\bigcup(k+n \mathbb Z)$
Because $\{k+n \mathbb Z : k \in \mathbb Z\}$ has $n$ elements and $f$ is surjective, then I have at most $n$ equivalence classes $[k]$. We denote elements of $\{k+n \mathbb Z : k \in \mathbb Z\}$ as $\overline{0},...,\overline{n-1}$.
Take $\overline{k_1},\overline{k_2}$ from $\{k+n \mathbb Z : k \in \mathbb Z\}$, then 
$$f(\overline{k_1})=f(\overline{k_2}) \iff (-k_1+n \mathbb Z)\bigcup(k_1+n \mathbb Z) = (-k_2+n \mathbb Z)\bigcup(k_2+n \mathbb Z)$$
Because $(k_1+n \mathbb Z)\bigcap(k_2+n \mathbb Z)=\emptyset$ and $(-k_1+n \mathbb Z)\bigcap(-k_2+n \mathbb Z)=\emptyset$ it follows that:
$$(-k_1+n \mathbb Z)\bigcup(k_1+n \mathbb Z)=(-k_2+n \mathbb Z)\bigcup(k_2+n \mathbb Z) \iff ( x \in (k_1+n \mathbb Z) \iff x \in (-k_2+n \mathbb Z) ) \land ( x \in (k_2+n \mathbb Z) \iff x \in (-k_1+n \mathbb Z) ) \iff \overline{k_1} = -\overline{k_2} \iff \overline{k_1} = \overline{n-k_2} $$
So $f(\overline{k_1})=f(\overline{k_2}) \iff \overline{k_1}=\overline{n-k_2}$. 
Now I go through elements $\overline{0},...,\overline{n-1}$ and try to find for each $\overline{k_1}$ a $\overline{k_2}$ such that $\overline{k_1}=\overline{n-k_2}$. Clearly $\overline{0}$ can not be paired, and whether all elements in $\overline{1},...,\overline{n-1}$ can be paired depends on whether $n$ is even or odd.  
Thus if $n$ is odd, then there are $\frac{n+1}{2}$ equivalence classes (and elements in my set), and if $n$ is even, then $\frac{n}{2}+1$ equivalence classes (and elements in my set).
 A: First, $k$ only influences the cosine modulo $n$. If you replace $k$ by $k+Mn$, i.e. shift it by a multiple of $n$ where $M$ is any integer, the cosine is the same.
For this reason, it's enough to count the number of values of the cosines for $k=0,1,2,\dots n-1$. Or, let's shift the interval to integers such that 
$$ -\frac{n}{2} \lt k \leq \frac n2$$
so that one period is covered. The cosine is an even function so $k\to -k$ doesn't change the cosine, either. That's why it's enough to count the number of the values of cosines for the integer values of $k$ such that
$$0\leq k \leq \frac{n}{2}$$
For an even $k$, the number of values is $1+n/2$, from zero to $n/2$. For an odd $k$, it is $(1+n)/2$, from zero to $(n-1)/2$. So we may unify it as $1+{\rm floor}(n/2)$ where "floor" is the largest integer not larger than the argument.
A: The cosine is periodic with period $2\pi.$ This implies that every equivalence class has a least one representative in $\{0,\ldots,n-1\}$ so you can limit your search for equivalences to that set.
The cosine is also bijective on $[0,+\pi]$ so the only possibility of having nontrivial equivalence classes in $\{0,\ldots,n-1\}$ is when $k+l=n.$ That should help you count the classes. You may need to distinguish cases according to the remainder of $n$ after division by 2.
