\[
\newcommand{\C}{\mathbb{C}}
\newcommand{\haar}{\mathsf{m}}
\newcommand{\P}{\mathcal{P}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\d}{\mathsf{d}}
\newcommand{\g}{>}
\newcommand{\l}{<}
\newcommand{\intd}{\,\mathsf{d}}
\newcommand{\Re}{\mathsf{Re}}
\newcommand{\area}{\mathop{\mathsf{Area}}}
\newcommand{\met}{\mathop{\mathsf{d}}}
\newcommand{\emptyset}{\varnothing}
\newcommand{\B}{\mathscr{B}}
\newcommand{\fou}{\mathcal{F}}
\]
For these problems $(X,\B,\mu)$ is the measure space where $X = [0,2\pi]$ and $\B$ is the Borel σ-algebra on $[0,2\pi]$ and $\mu$ is the restriction of Lebesgue measure to $[0,2\pi]$.
Take for granted that if $f : [0,2 \pi] \to \R$ is continuous then its integral with respect to $\mu$ equals its Riemann integral on $[0,2\pi]$.
- Verify that $\phi_1(x) = 1$ and $\phi_{2n+1}(x) = \cos(n x)$ and $\phi_{2n}(x) = \sin(nx)$ both belong to $\mathsf{L}^{\!\mathsf{2}}([0,2\pi],\B,\mu)$ for all $n \in \N$.
- Check that
\[
\langle f, g \rangle = \dfrac{1}{2\pi} \int f \cdot g \intd \mu
\]
defines an inner product on $\mathsf{L}^{\!\mathsf{2}}([0,2\pi],\B,\mu)$.
- Check that $\phi_0,\phi_1,\phi_2,\dots$ is an orthonormal collection of functions for the above inner product.
Define
\[
(\fou f)(n) = \langle f, \phi_n \rangle
\]
for all $n \ge 0$ and all $f$ in $\mathsf{L}^{\!\mathsf{2}}([0,2\pi],\B,\mu)$.
- By expanding
\[
\left\| f - \sum_{n=0}^N \langle f, \phi_n \rangle \phi_n \right\|_\mathsf{2}^\mathsf{2}
\]
prove Bessel's inequality that
\[
\sum_{n=0}^N | (\fou f)(n) |^2 \le \| f \|_\mathsf{2}^\mathsf{2}
\]
for all $N \in \N$ and conclude $\fou f$ always belongs to $\ell^\mathsf{2}(\N \cup \{0\})$.