Can a non-periodic function have a Fourier series? Consider two periodic functions. Assume their sum is not periodic.
The periodic functions can be represented by a Fourier series. If you add up the Fourier series, you get a series that represents their sum. But their sum is not periodic, yet you have described it using a Fourier series.
I thought that non-periodic functions can't be represented by a Fourier series. Why isn't this a contradiction?
 A: A Fourier series means the amplitude of the different harmonics, who are an integer multiple of a base frequency.
It is easy to see, that this base frequency simply doesn't exist in your case.
Although a Fourier transform of a such function of course exist, which is trivially 
$$F(s)=\delta(t-\omega_1)+\delta(t-\omega_2)$$
A: To answer the original question: it's a matter of convention or terminology. The most usual usage (as visible in the other answers and comments) is that "Fourier series" refers to that of a periodic function, or an extension-by-periodicity of a function on an interval to a periodic function on the line. In particular, a sum of sines and cosines, or exponentials, with some incommensurable periods, would often not be considered a Fourier series.
Yet, certainly such a thing is a sum of cosines and sines, or exponentials, so it's related in some ways. Such things were investigated at length in the early 20th century by Harald Bohr and others, in part to look at the behavior of Dirichlet series.
So, on one hand, in some contexts "Fourier series" means "of periodic function". In others, it might not.
A: In order to find its Fourier series, a periodic function with period $R$ should be thought of as a function defined on a circle of circumference $R$, call it $S^1_R$. The Fourier series of the function is then its representation in the basis of $L^2(S^1_R)$ given by orthonormal eigenfunctions of the Laplace operator. 
If two functions have incommensurate periods, then their sum is nonperiodic, does not descend to a circle of any circumference, and therefore does not have a Fourier series.
As functions on $\mathbb{R}$, if they are sufficiently nice, the Fourier transform gives an analogous decomposition, but because there are so many more eigenfunctions of the Laplace operator on $\mathbb{R}$, the sum is an integral. Compare:
Let $e_\omega(t) = e^{2\pi i\omega t}$ for $\omega$ real.
$$ \mbox{periodic ($\omega$ is an integral multiple of a base frequency): }\\ f(t) = \sum_\omega\langle f,e_\omega(t)\rangle e_\omega$$
$$ \mbox{nonperiodic ($\omega$ ranges over $\mathbb{R}$): }\\ f(t) = \int\langle f,e_\omega(t)\rangle e_\omega\ d\omega$$
where
$$\langle f,e_\omega\rangle = \int f(x)\overline{e_\omega(x)}\ dx$$
You will recognize that if we integrate over the circle, $\langle f,e_\omega\rangle$ gives the series of Fourier coefficients and if we integrate over $\mathbb{R}$, it is the Fourier transform.
A: The Fourier series of a non-periodic function is really the Fourier series of its periodic extension. For example, there is a Fourier series of $f(x)=x$ on $[0,\pi]$, which is actually the Fourier series of the sawtooth wave that is formed by periodically extending $f(x)=x$. The Fourier series for a non-periodic function will not converge at every point but will still converge in the sense of $L^2$.
Also, Fourier series are not meant to be defined on the whole line, they are indeed meant to be defined on intervals. This has to do with the changes in the spectrum of the Laplacian as the domain increases: in the limit, the spectrum becomes dense, and you have to turn to the Fourier transform instead of Fourier series.
A: There are Fourier series representations for a number of non-periodic functions such as the following:
(1) $\quad\pi(x)$ - the fundamental prime counting function
(2) $\quad\Pi(x)$ - Riemann's prime-power counting function
(3) $\quad\vartheta(x)$ - the first Chebyshev function
(4) $\quad\psi(x)$ - the second Chebyshev function
(5) $\quad U(x)=-1+\theta(x+1)+\theta(x-1)$ - where $\theta(x)$ is the Heaviside step function
I believe the following link provides a fair amount of insight into the theory and value of Fourier series representations of non-periodic functions.
Fourier Series Representation of $U(x)$
To more precisely answer the specific question, assuming the ratio of the periods of the two functions is not rational, then the sum of their Fourier series doesn't converge when evaluated at finite evaluation limits. A conditional convergence requirement for sums of Fourier series is that all Fourier series must be evaluated to exactly the same frequency, and this condition can not be met if the ratio of the periods of the two functions is irrational.
For example consider the following two functions:
(6) $\quad f(x)=\operatorname{SawtoothWave}(\frac{x}{3})=\frac{1}{2}-\frac{1}{\pi}\sum\limits_{k=1}^\infty\frac{\sin\left(\frac{2\,k\,\pi\,x}{3}\right)}{k}$
(7) $\quad g(x)=\operatorname{SawtoothWave}(\frac{x}{5})=\frac{1}{2}-\frac{1}{\pi}\sum\limits_{k=1}^\infty\frac{\sin\left(\frac{2\,k\,\pi\,x}{5}\right)}{k}$
When evaluated at finite limits, the sum $f(x)+g(x)$ must be evaluated as follows where the evaluation frequency $f$ is assumed to be a positive integer:
(8) $\quad f(x)+g(x)=\sum\limits_{n\in\{3,5\}}\frac{1}{2}-\frac{1}{\pi}\sum\limits_{k=1}^{f\,n}\frac{\sin\left(\frac{2\,k\,\pi\,x}{n}\right)}{k}$
A: Assume your two signals have periods $T'$ and $T''$, and form the pairwise sum of their Fourier coefficients. But can you tell the period of the signal corresponding to that sum ??? What $T$ would you choose to reconstruct ?
Actually, if you are summing the terms pairwise, you are artificially rescaling the signals in time in such a way that they get the same period and the same harmonic frequencies.
