I am having some problem on my arguments and I want to see where it fails. It deals with pointwise convergence in $L^2[-\pi,\pi]$: pointwise convergence is given by Carleson's Theorem (so it is a hard result!) so my following argument must be wrong.
First, pick your function $f\in L^2[-\pi,\pi]$, and consider $B=\{g_k\}_{k\geq 0}$ to be the family or orthogonal functions $\frac{1}{\sqrt{2\pi}}, \frac{1}{\sqrt{\pi}}\cos(nx)$ and the corresponding normalized sinus term. We know that $B$ is complete, namely if $(f,g)=0$ for all $g\in B$, then necessarily $f$ is equal to $0$ (almost everywhere).
We also know (by Riesz-Fischer theorem) that $L^2$ is a complete space, so for any sequence $\{c_k\}_{k\geq 0}$ with $\sum_{k\geq 0} c_k^2< \infty$, the function
$$\bar{f}=\sum_{k\geq 0}c_k g_k$$
is inside $L^2$, and working just a little we see that for each $k$, $(\bar{f},g_k)$ is precisely $c_k$.
So, now, let us take $f$ with Fourier coefficients $c_k=(f,g_k)$, which, by Bessel, satisfies that $\sum_{k\geq 0} c_k^2 <\infty$. With these coefficients we can define the corresponding function $\bar{f}$.
Then, here it comes the crutial argument where I get lost/probably doing a mistake: as for every $k$ we have that $(f,g_k)=(\bar{f},g_k)=c_k$, then $(f-\bar{f},g_k)=0$. As $B$ is a complete family, this means that necessarily $f=\bar{f}$ almost everywhere.
But this is telling us precisely that the Fourier series of $f$ convergences pointwise almost everywhere to $f$, which is the content of Carleson's Theorem.
So, what I am doing wrong?