I have come across the expression
$$ \sum_{k = 0}^{N - 1} \cos \left( \frac{2 \pi}{N}\left(k + \frac{1}{2}\right)\right) $$
and I happened to notice that it equals $0$ for all integer values of $N > 1$. This it very easy to prove for $N$ even, by noticing some symmetries in the angles that appear in the arguments of the cosines. This does not work for $N$ odd. When trying to prove it for $N$ odd, I split it as
$$ \sum_{k = 0}^{N - 1} \cos \left( \frac{2 \pi}{N}\left(k + \frac{1}{2}\right)\right) = \cos\left(\frac{\pi}{N} \right)\sum_{k = 0}^{N-1} \cos \left(\frac{2 \pi}{N}k\right) - \sin\left(\frac{\pi}{N} \right)\sum_{k = 0}^{N-1} \sin \left(\frac{2 \pi}{N}k\right)$$
and noticed (by checking it numerically) that the two terms are individually $0$ for all integer $N > 1$
$$\sum_{k = 0}^{N-1} \cos \left(\frac{2 \pi}{N}k\right) = 0 = \sum_{k = 0}^{N-1} \sin \left(\frac{2 \pi}{N}k\right).$$
From here I don't know to proceed. I have thought of applying some ideas from Fourier series, maybe thinking of the sums as the series of a function evaluated at $x = 1$, but I've got nothing concrete.
How to prove the statement for $N$ odd? Or even better, how to prove it for generic $N$?