To show that a set of vectors is a basis for a vector space you need to show two things:
- The vectors are linear independent
- The vectors span the set.
In the case of fourier expansion it is not very hard to show that the 'vectors' are linear independent.
$$ ⟨e_n,e_m⟩=2π \delta_{mn} $$
$$ \int_{-\pi}^{\pi}{e^{inx}e^{-imx}dx}={2\pi\delta}_{mn} $$
However, how do you show that the basis vectors $\vec{e}_n= e^{inx}$ span the complete 'set', i.e. every function can be written as a linear combination of basis vectors?
$$f(x)=\sum_{n=-\infty}^\infty c_n e^{inx} $$
For a countable finite set of basis vectors you can calculate check if the matrix filled with basisvectors is nonsingular. However for a countable infinite set of basis vectors this seems not the way to go. For an uncountable infinite set of basis vectors I also don't know how to show this. I tried to show it like this, to show that the distance between the function $f(x)$ and the linear combination of basis vectors is $0$:
$$d\left(f\left(x\right),\sum{c_ne^{ik_nx}}\right)=\left|\left|f-\sum{c_ne^{ik_nx}}\right|\right|$$
$$\left|\left|f\right|\right|=\sqrt{\langle f,f ⟩}$$
$$\left|\left|f-\sum{c_ne^{ik_nx}}\right|\right|=\int_{-\pi}^{+\pi}\left[f\left(x\right)^2-2f\left(x\right)\sum{c_ne^{ik_nx}}+\left(\sum{c_ne^{ik_nx}}\right)^2\right]dx$$
$$\int_{-\pi}^{+\pi}\left(\sum{c_ne^{ik_nx}}\right)\left(\sum{c_me^{-ik_mx}}\right)dx=2\pi\delta_{mn} c_n c_m$$
$$\int_{-\pi}^{+\pi}{f\left(x\right)\sum{c_ne^{ik_nx}}dx}=|c_n|^2 $$
$$\left|\left|f-\sum{c_ne^{ik_nx}}\right|\right|=\left|\left|f\right|\right|^2-\left|\left|c_n\right|\right|^2$$
I do not know if I am on the right track and how to proceed.
Looking at your notation, it seems like you're trying to prove the following statement:
Let's write this out again, this time spelling out what we mean by that infinite sum.
Proving this is not at all trivial! I'll sketch out the structure of one possible proof.
Step 1. Let $S$ be the set of finite linear combinations of the $e_n$'s. Then $S$ is dense in the space of continuous functions $C(-\pi, \pi)$ with respect to the supremum norm. This can be proved by applying the Stone-Weierstrass theorem.
Step 2. $C(-\pi, \pi)$ is dense in $L_2(-\pi, \pi)$ with respect to the $L_2(-\pi, \pi)$ norm. This can be proved by showing that elements of $L_2(-\pi, \pi)$ can be approximated by simple functions, and that simple functions can in turn be approximated by continuous functions. (See Lusin's theorem for the second claim.)
Since convergence w.r.t. the suprenum norm implies convergence w.r.t. the $L_2$ norm, Steps 1 and 2 together implies that $S$ is dense in $L_2(-\pi, \pi)$ with respect to the $L_2$ norm.
Step 3 Prove that "Pythagoras' theorem" $\left\| f \right\|^2 = \sum_{n=1}^\infty |(f, e_n)|^2$ holds for $f \in S$, and also holds on for $f \in \bar S$, where $\bar S$ is the closure of $S$ in $L^2(-\pi, \pi)$. Deduce that if $f \in \bar S$, then $f = \sum_{n=1}^\infty (f, e_n)e_n$.
Since $\bar S$ is the whole of $L^2(-\pi, \pi)$ by Step 2, this implies that $f = \sum_{n=1}^\infty c_ne_n$ where $c_n = (f, e_n)$.