What are the conditions for existence of the Fourier series expansion of a function $f\colon\mathbb{R}\to\mathbb{R}$ What are the conditions for existence of the Fourier series expansion of a function $f\colon\mathbb{R}\to\mathbb{R}$?

If $f\in L^1_\text{loc}(\mathbb{R})$, then on an interval $I=(a,b)$ we can define 
$$\hat{f}(n)=\frac{1}{b-a}\int_a^b f(x)e^{-2\pi inx/(b-a)}dx.$$
However, in order for the formal Fourier series $$S[f](x)=\sum_{-\infty}^{\infty} \hat{f}(n)e^{2\pi inx/(b-a)}$$ to converge we need more conditions on $f$. 
Kolmogorov proved in 1925 that  there is $f\in L^1(0,2\pi)$ such that $S[f]$ diverges almost everywhere. In 1966 Carleson proved that $S[f]$ converges almost everywhere provided $f\in L^2(0,2\pi)$.
