I have a very simple question that I would like to understand. If you have a DFT of a function:
$$ X_k \stackrel{\mathrm{def}}{=}\sum_{n=0}^{N-1}x_n\cdot e^{-i2\pi kn/N},\qquad k\in\mathbb{Z} $$
Did I understand correctly that that $N$th harmonic is the same as the $0$th - because of periodicity? I know this is probably a stupid question, but I would be grateful if someone could shed some light on it. Thank you!
First there is a terminology issue here, the term "harmonic" has its issues, as discussed in other answer.
Leaving that aside, assuming that by the "$k-$th harmonic" we just mean the $k$-th discretized frequency:
In some sense, you are right. $X_k$, in the DFT is periodic in $k$, with period $N$, so $X_0 = X_N$ (and $X_1 = X_{N-1}$). But that's rather trivial. And, actually, in a DFT, we normally think of the index $k$ as taking values in the range $0 \cdots N-1$.
Further, for a discretized finite signal of $N$ samples, the "highest harmonic" (better: highest frequency) you can meaningfully consider in a Fourier transform is that which corresponds to a period of 2 time steps (Nyquist theorem). And if you are using a DTF (as in your formula), that corresponds, not to $k=N$ but to $k=N/2$.
Furthermore: if the signal is real, then $|X_k|=|X_{N-k}|$ So, for example, $|X_1| = |X_{N-1}|$