How did Fourier arrive at the following regarding his series and coefficients? I am reading Karen Saxe's "Beginning Functional Analysis." Perhaps it is poor exposition on her part, but she states:

...Fourier begins with an arbitrary function $f$ on the interval from
  $-\pi$ to $\pi$ and states that if we can write $$f(x) = \frac{a_0}{2}
 + \sum_{k = 1}^\infty a_k\cos(kx) + b_k\sin(kx),$$ then it must be the case that the coefficients $a_k$ and $b_k$ are given by the
  formulas...

and then she states the formulas for $a_k$ and $b_k$. However she does not elaborate further on why Fourier concluded this. This is unsatisfactory to me because I would like to know the motivation behind this conclusion. How did he know that it must be the case that this is true?
Also, it is unclear why we don't rewrite $\frac{a_0}{2}$ as $b_0$ since it would seem that $a_0$ is just some constant.

If
$$
f(x) = \frac{a_0}{2} + \sum_{k = 1}^\infty a_k\cos(kx) + b_k\sin(kx)
$$
then
$$
\int_{-\pi}^\pi f(x)\cos (nx)\,dx = \int_{-\pi}^\pi \quad \underbrace{\left\{ \frac{a_0}{2} + \sum_{k = 1}^\infty a_k\cos(kx) + b_k\sin(kx) \right\}} \quad  \cos(nx)\,dx
$$
because the part over the $\underbrace{\text{underbrace}}$ is the same as $f(x)$.
So now notice that one of the values of $k$ is equal to $n$ and all the others are not.  For the terms in which $k\ne n$, the integral is zero.  Hence you have
$$
\int_{-\pi}^\pi f(x)\cos (nx)\,dx = \int_{-\pi}^\pi a_n \cos^2(nx)\,dx = a_n \,\pi.
$$
Hence
$$
a_n = \frac 1 \pi \int_{-\pi}^\pi f(x)\cos(nx)\,dx.
$$
