Every function can be represented as a Fourier Series - but why? I can't really find a good answer to this question - the statement just seems to be assumed everywhere I look. Admittedly, I am not too well versed in the topic but I am an engineer and can understand Fourier Transforms up to a point. But in researching the JPEG algorithm I am led back to the very beginning.
The question seems to be related to the convergence of a Fourier series to a function, but I'm not so concerned with IF a series converges to a function then I am concerned with how Joseph Fourier made this breakthrough in the first place. Did he just think about it and then say it was so? Is there a mathematical proof that says that every periodic function can be represented by sines and cosines? 
(Also, if possible, ELI5)
 A: In the mid 1700's, Bernoulli was studying the problem of a vibrating string, and he had proposed a general solution in terms of standing waves. Euler realized that, if Bernoulli's solution were to be general, it would be necessary to be able to expand the initial displacement function of the string in a trigonometric series, which is now called the Fourier series:
$$
             f \sim \frac{a_0}{2}+a_1\cos(x)+b_1\sin(x)+a_2\cos(2x)+b_2\sin(2x)+\cdots.
$$
Remarkably, Clairaut and Euler discovered the orthogonality conditions that are needed to isolate the coefficients in such an expansion. They noticed that if you multiply any two of the functions $1,\cos(x),\sin(x),\cos(2x),\sin(2x),\cdots$ and integrate over $[0,2\pi]$, you get $0$ for the answer unless the two functions are the same. And that's how they first determined what the coefficients would have to be, if such an expansion were possible. Euler's opinion was that such an expansion could not be generally possible; instead he thought this represented a restriction on the possible initital displacement functions $f$ that could be used to solve the vibrating string problem in this manner.
Fourier decided that such an expansion would have to be possible, and he set out to prove it. Fourier conjectured that a general "mechanical" function could be expanded in such a series. Amateur Historians are quick to point out that Fourier's conjecture is not true for general Lebesgue integral functions, but they forget that Fourier was dealing with piecewise analytic functions where you could use anti-derivatives to determine integrals. That's all they could do at the time, because the Riemann integral was not invented until about a century later!
Fourier's conjecture was generally thought to be false by Mathematicians of his time. Fourier set out to prove the conjecture. Fourier came up with the Dirichlet integral representation in his treatise on Heat Conduction, which basically settled the issue for the types of functions of Fourier's time. Just as Fourier was falsely credited with the Fourier series and integral coefficient formulas, Dirichlet was falsely credited with Fourier's integral representation of the truncated series. This probably happened because Fourier's treatise was banned from publication for quite some time because of the controversial nature of his work, which was not generally accepted at the time. Historians accept that Fourier rigorously proved that general periodic functions of his time had Fourier expansions. You can find the proof in Fourier's 1811 treatise on Heat Conduction.
