Sine and cosine waves whose frequencies are multiples of a fundamental frequency, form an orthonormal basis w.r.t. the inner product given by integrating f(x)ĝ(x)dx over one period of the sine (or cosine) wave whose frequency is the fundamental frequency. In practical signal processing, this means that we can separately consider the contribution of each frequency to the total energy of a signal. Technically, the above only explains Fourier series, but the Fourier transform is just the limit case when the fundamental frequency is made arbitrarily small (re-scaled by a factor of the size of Dirac's delta at 0, of course).