Is there a single counterexample to "Any function can be represented with a fourier series" My lecturer has stated multiple times in lectures that any function can be represented as a Fourier series. Then in the notes it says any that satisfy some "mild mathematical restrictions". I did some googling and found on this page that we know the sufficient but not necessary conditions for a Fourier Series to be valid, and they are indeed tame. f(x) must be single valued, and have a finite number of discontinuities, maxima and minima. (In the region for which the series is defined.)
As my lecturer has pointed out, we can take a limit as the region tends to the whole real number line/complex plane and if the function is periodic we don't even need to do that. I am aware of some pretty pathological functions out there but most of the ones I know are defined as a Fourier Series! The Weierstrass function even has an infinite number of maxima/minima on any finite interval.
This got me wondering if we know of any function that cannot be represented as a Fourier series. I don't care if it's the most disgusting horrible function ever devised.
I just want to know if there's even one known counterexample to the statement "Any function can be represented as a Fourier Series", and more specifically, what it is.
Clarification on "represented as a Fourier Series":
So I'm only in third year physics and would be sufficiently impressed if it approached the function to the same degree as the jagged line in the classic "proof" that pi=4 approaches a circle, but ideally the full Fourier Series would be equivalent at all derivatives.
 A: There is a great deal of ambiguity in the meaning of both "function" and "represents" in this question, and the answer depends on how these ambiguities are resolved. We can compute the coefficients of a possible Fourier series on, say, the interval $[-\pi, \pi]$ for any function $f$ such that the integrals
$$c_k = \frac{1}{2\pi} \int_{-\pi}^{\pi} f(x) e^{-ikx} \, dx$$
exist; then what we'd like to do is understand in what sense $f(x)$ is "represented" by the Fourier series $\sum c_k e^{ikx}$.
The simplest interpretation of "represents" is that the sequence of partial sums $\sum_{k=-\ell}^{\ell} c_k e^{ikx}$ converges pointwise to $f(x)$. You can find very simple examples of functions for which this is false, such as the Heaviside step function, where pointwise convergence fails at $x = 0$ unless the function's value is defined to be $\frac{1}{2}$ there.
Another option is to ask for uniform convergence, a much stronger condition but one which is more useful for analytic arguments in practice. Unfortunately the sequence of partial sums are continuous, and a uniform limit of continuous functions is continuous, so no discontinuous function (such as the Heaviside step function again) is represented by its Fourier series in this sense.
An option that's easy to prove theorems about is $L^2$ convergence. In this case we have the nice theorem that $L^2$ convergence holds as long as $f$ has finite $L^2$ norm, meaning that $\int_{-\pi}^{\pi} |f(x)|^2 \, dx < \infty$. However, $L^2$ convergence has some unintuitive properties; the Fourier series can fail to converge pointwise on a set of measure zero, for example. There are also still functions which don't satisfy even this fairly weak condition that the $L^2$ norm is finite, such as $f(x) = \frac{1}{x}$.
A nice thing about the condition that $f$ has finite $L^2$ norm is that it guarantees that the Fourier integrals $c_k$ all actually exist. In general they may not; a simple counterexample is to take $\boxed{ f(x) = \frac{1}{x^2} }$. With this function none of the Fourier integrals exist so $f(x)$ doesn't even have a sequence of coefficients that one might take as the coefficients of a Fourier series.
(Even here if you insist on trying to give $\frac{1}{x^2}$ a Fourier series you can try the following: first compute a Fourier series for $\frac{1}{x}$ by interpreting the divergent integrals defining the coefficients $c_k$ in the Cauchy principal value sense, then differentiate this series term-by-term. The resulting Fourier series has coefficients that don't go to zero so it cannot possibly converge in the usual sense anywhere. Nonetheless one might try to make sense of it. This gets into subtleties about the meaning of the word "function"; I believe this formal computation can be justified using distributions but I am not familiar with the details.)
For a very well-written and friendly introduction to some of these analytic issues I suggest Stein and Shakarchi's Fourier Analysis: An Introduction. There is also a Wikipedia article. The question of convergence of Fourier series is quite delicate and was in fact a historical motivation for Cantor to develop set theory.
