The compactness of $\{x_n=cos nt\}_{n\in\mathbb{N}}\in L_2[-\pi,\pi]$ Is the set $\{x_n=\cos (nt): n\in\mathbb{N}\}$ in $L_2[-\pi,\pi]$closed or compact? I don't know how to prove it.

As the elements are orthogonal, we have for $n\neq m$ that 
$$\lVert x_n-x_m\rVert_{L^2}^2=2,$$
proving that the set cannot be compact (it's not precompact, as the definition doesn't work for $\varepsilon=1/2$).
But it's a closed set, as it's the orthogonal of the even square-integrable functions. 
