Let $f$ be a function in $C(\mathbb{R}/\mathbb{Z} ; \mathbb{C})$, and define the trigonometric Fourier coefficients $a_n, b_n$ for $n = 0,1,2,3,...$ by
$$a_n: = 2\int_{[0,1]}f(x) \cos(2\pi n x) dx, \space b_n : = 2\int_{[0,1]}f(x) \sin(2\pi n x) dx.$$
(a) Show that the series $$\frac12a_0 + \sum_{n=1}^\infty(a_n \cos(2 \pi n x) + b_n \sin(2 \pi n x))$$ converges in $L^2$ metric to $f$. (Hint: use the Fourier theorem, and break up the exponentials into sines and cosines. Combine the positive $n$ terms with the negative $n$ terms.)
Let $\hat{f}: \mathbb{Z} \to \mathbb{C}$ be a Fourier transform defined by $\hat{f}(n) := \langle f, e_n \rangle$, where $e_n(x) : = e^{2\pi i n x}$. Then, $$\langle f, e_n \rangle =\int_{[0,1]} f(x) e^{-2\pi i n x} = \int_{[0,1]}f(x) \cos(2\pi n x) - i\int_{[0,1]} f(x) \sin(2\pi nx) = \frac12 a_n - \frac12i b_n.$$
I know that the Fourier series $\sum_{n = -N}^N \hat{f}(n) e_n$ converges in $L^2$ to $f$. Thus, I have to show that $\sum_{n = -\infty}^\infty \hat{f}(n) e_n = \frac12a_0 + \sum_{n=1}^\infty(a_n \cos(2 \pi n x) + b_n \sin(2 \pi n x))$. When I replace $\hat{f}(n)$ by $\frac12 a_n - \frac12 i b_n$, and $e_n$ by $\cos(2\pi nx) + i\sin(2\pi n x)$, I have that $$\sum_{n = -\infty}^\infty \hat{f}(n) e_n =\frac12 a_0 + \sum_{n=1}^\infty(a_n \cos(2 \pi n x) + b_n \sin(2 \pi n x))+ \frac12 i(\sum_{n=1}^\infty(a_n \sin(2 \pi n x) - b_n \cos(2 \pi n x)).$$
If the last term is equal to zero, I finish the proof, but I don't know how to do this. I would appreciate if you give some help.