This inequality must be well known, and possibly easy to prove but I could not find it in the literature or here.
Does anyone have a proof of $$ \forall n\in \mathbb{N}^*, \forall x_k \in \mathbb{R}, \sum\limits_{i=1}^n \sum\limits_{j=1}^n \cos(x_i - x_j) \geq 0. $$ P.S.: The cases $n=2$ and $x_1=0$, $x_2 = \pi$, or the case $n=4$ and $x_k= \frac{k-1}{2}\pi$, etc... show that the inequality is sharp.
Note that $\cos(x)=\operatorname{Re}e^{ix}$. So, $$\sum_{i=1}^n\sum_{j=1}^n\cos(x_i-x_j)=\operatorname{Re}\sum_{i=1}^n\sum_{j=1}^n e^{i(x_i-x_j)}.$$ This sum can be factored as $$\sum_{i=1}^ne^{ix_i}\sum_{j=1}^ne^{-ix_j}=z\overline z,$$ where $z=\sum e^{ix_j}$ is a complex number. Since $z\overline z$ is a nonnegative real, its real part is positive, as desired.