Any function $f(x)$ can be represented as a sum of an odd and even function.
That is, $f(x)$ is a direct sum of the subspace of odd functions $F_o$ and the subspace of even functions $F_e$.
$$ f(x) = F_e + F_o $$
Notice, that when we represent a function as a Fourier Series, we have a infinite sum below:
$$f(x) = \sum^{\infty}_{n=0} B_n sin(\frac{n \pi x}{L}) + \sum^{\infty}_{n=0} A_n cos(\frac{n \pi x}{L})$$
So if we compare this to $ f(x) = F_e + F_o $, we can see that the odd "part" $F_o$ for of function $f(x)$ is represented by a linear combination of the sines
$$F_o = \sum^{\infty}_{n=0} B_n sin(\frac{n \pi x}{L}) $$
and similarly for the even function
$$F_e = \sum^{\infty}_{n=0} A_n cos(\frac{n \pi x}{L})$$
Therefore, it must be that the cosine/sine series form a basis for the even/odd functions. And because the vector space of functions is a direct sum of the the even functions and the odd functions, a function can hence be represented by a Fourier Series.
However, why does the cosine/sine form a basis for the vector space of even/odd functions?
Explicitly, why do these sine terms form a basis for odd functions
$$ \sum^{\infty}_{n=0} B_n sin(\frac{n \pi x}{L}) $$
and why do these cosine terms form a basis for even functions
$$ \sum^{\infty}_{n=0} A_n cos(\frac{n \pi x}{L})$$
Thank you.