What is the relationship between generalized functions and things like the Riesz representation theorem? I just watched this video of Prof. Osgood's lecture on Fourier Transforms, and it seems to me that there's some connection between his talk of distributions (generalized functions) and the usual linear algebra I'm familiar with. He mentions many times that the dirac delta function classically doesn't make any sense. I agree with him, but then he shows that one can represent the dirac delta function as a continuous linear functional. I'm a bit confused, because the Riesz representation theorem says that elements of a Hilbert space $H$ correspond bijectively with continuous linear functionals on $H$. So there must be some function that actually does everything we want out of the dirac delta function, right?
I think the difference here is that the chosen measure is also part of the equation, but I haven't quite put my finger on it. So my question is: what part of the Riesz representation theorem fails for this?
 A: I thought I should expand a bit on my earlier answer.
As I see it, there are two questions here: do generalized functions
make sense on any Hilbert space and if not is there an analogue of
a classical Riesz representation theorem which is valid here?
To answer the first question, the first thing we need to rule out
is the $\delta$ function as a functional on $L^{2}$ I would argue
that the big issue here is that $L^{2}$ functions do not exist pointwise--you
can change their value on any set of measure zero without changing
the function. Because of this, there is no hope of making sense of
$\delta$ over the Hilbert space you are used to.
The natural question then becomes what space we should work on. I
would argue that the most important property of generalized functions
is that they are all 'smooth' in the distributional sense (i.e.
infinitely differentiable). If this is the property that you want
them to have, then you need at least that level of regularity on the
test functions you apply the generalized functions to (since by duality
we apply all the derivatives to the test function to define the distributional
derivative). This is essentially the trade-off one usually sees when
defining objects through duality: the more structure you put on the
test objects, the less structure you need on your dual objects to
get nice properties. This natural path leads one to the theory of
distributions, which are the continuous linear functionals on the
space $C_{0}^{\infty}$ with a particularly nasty (not even metrizible) but entirely natural topology on it. 
For a sequence of test functions to converge in $C_{0}^{\infty}$
we need two things: they need to live in a single common compact set
(so no infinitely expanding supports) and all of the partial derivatives
have to converge in the infinity norm, i.e. $\|\partial^{\alpha}\varphi_{n}-\partial^{\alpha}\varphi\|_{\infty}\to0$
for all multiindices $\alpha.$ Continuity of a functional linear
functional $T$ in the dual means that if $\varphi_{n}\to\varphi$
in this topology, then $T\varphi_{n}\to T\varphi.$ As a comment,
this is not good enough to specify the topology since we are not working
on a metric space. To prove that this space is not metrizible, we
would actually have to go through the nitty gritty details of its
construction. It's not too terrible if you have a background in topological
vector spaces, but it's not edifying if you don't so I won't. The
important property for our purposes is that there is no metric space
with the same topology as the one we gave to $C_{0}^{\infty}.$ In
particular, it does not admit a Hilbert space structure. Now, Hilbert
spaces are all self-dual (this is the Riesz theorem you are used to),
which means that $C_{0}^{\infty*}$also does not admit a Hilbert space
structure. The answer to the first question is therefore no. Generalized
functions do not make sense over a Hilbert space.
Before going into the second question, let me comment that there are
a lot of 'Riesz representation theorems.' All that these theorems
have in common is that over many nice spaces there is a natural class
of continuous linear functionals (on a Hilbert space, it is given
by the inner product; on $L^{p}$ it is given by multiplication by
an $L^{q}$ function and justified by Holder's inequality; on $C_{0}$
it is given by integration against a Borel measure). The common trait
of Riesz-type theorems is that they say that all functionals belong
to this natural class of functionals. The obvious class in our case
is integration against Borel measures (since our functions are still
continuous), but we cannot apply the classical Riesz-Markov theorem
since we changed the topology of the space we are working over. It
turns out the result is false in any case: the objects we are working
with have too much structure for measures to be able to distinguish
between all of them. 
The fact that the $\delta$ function is represented as a measure when
viewed as a functional over $C_{0}^{\infty}$ is a manifestation of
the fact that all positive distributions (that is all continuous linear
functionals $T$ on $C_{0}^{\infty}$ with the property that if $f\geq0$
then $Tf\geq0$) are represented as measures.
For an example of why we cannot apply Riesz-Markov here, I do not believe that the generalized function given by the derivative of the Dirac delta is represented as a measure.
A: The Dirac delta is simply the functional $\delta:f\mapsto f(0)$ on $C_0(\mathbb{R})$. It can also be seen as a integral (via Riesz-Markov if you want, but one can check it directly):
$$
\delta(f)=\int_\mathbb{R}\,f\,d\mu_\delta,
$$
where $\mu_\delta$ is the measure defined on the full power set of $\mathbb{R}$ by
$$
\mu_\delta(A)=\begin{cases}1&\text{ if } 0\in A\\ 0&\text{ if }0\not\in A\end{cases}
$$
The only "confusion" with the delta arises if you want (as it was done intuitively a long time ago, but is actually impossible) to think of $\mu_\delta$ as $g(t)dt$ for some function $g$. 
To answer your question proper, as others have already  mentioned, the "Riesz theorem" that you think about (the one about Hilbert spaces) is not relevant here. The relevant one is Riesz-Markov. 
A: First of all the spaces are not reflexives or Hilbert, on the other hand the Riez-Markov Theorem says that the dual of $C^0[0,1]$ is isometric to the Borelian measures o $[0,1]$. 
Second when you are deriving in the sense of  the distribution you can derive pretty much everything. 
Third the delta function is the derivative (in the distribution sense) of the  Heaviside function and it is a distribution that could be a miserably irregular but it happens to be a Borelian measure that assigns value one to a Borel set that contains 0 and assigns zero to the other Borel sets. 
A: I beg to differ on this from the other answerers and would like to claim that the question makes sense in its intended meaning. For instance, the delta "function" can be represented by a function under a Hilbert space inner product.
This just means that a nice function can represent something nasty as an inner product. But remember that the $L^2$-inner product is not enough to represent the delta function, i.e., the delta function cannot be represented as the integral
$$
\delta(f) = \int fg,
$$
for some function $g$. One has to involve derivatives of $f$ in the integral, e.g., in one dimension
$$
\delta(f) = \int_{-1}^1 \big(f(x)g(x)+f'(x)g'(x)\big)\mathrm{d}x,
$$
would work with some function $g$, for all functions $f$ in the Sobolev space $H^1_0((-1,1))$. Note that the above integral is the $H^1$-inner product between $f$ and $g$. In effect, if you want to represent objects like the delta function by an inner product involving derivatives such as the above, you end up solving a differential equation such as $g''=\delta$ with the right hand side given by the object. In general, it is true that $\delta$ is in the dual of $H^s(\Omega)$ as long as $H^s(\Omega)$ is continuously embedded in $C(\Omega)$.
A: In addition to other good points made in other answers... :
As noted, there is a "Riesz repn theorem" for Hilbert spaces (not so hard to prove), and also the (much more serious) Riesz-Markov-Kakutani theorem about continuous linear functionals on compactly-supported continuous functions.
In my own experience, I have found it quite illuminating to give both spaces of "nice" functions and their dual spaces a finer gradation than just $C_c^\infty\subset \mathscr S \subset L^2 \subset \mathscr S' \subset (C_c^\infty)^*$.
To dodge some relatively secondary issues about compact support (or not), let's just look at functions on the circle. Then, yes, there is the natural gradation $C^\infty\subset ... \subset C^k\subset ... \subset C^1\subset C^0$. In fact, $C^\infty$ is the projective limit. A minor complaint is that these spaces are Banach, not Hilbert, so do not have a (true) minimum principle. Also, although the R-M-K theorem identifies the dual of $C^0$ in tangible terms (regular Borel measures), it doesn't quite achieve this for the other duals.
A non-obvious, very useful variant, observed already c. 1906 by G. Levi and 1907 by G. Frobenius, is to form $L^2$ Sobolev spaces $H^s$ (an anachronistic name). Without going into details, an important point ("Rellich lemma") is that $H^s\subset C^0$ for $s>1/2$. And $\delta$ is in $H^{-s}$ for $s>1/2$.
Further, Dirac's very insightful work in the late 1920's and early 1930's did use the Hilbert space pairings among these spaces, to great advantage. Sobolev formalized some of this c. 1940, and then L. Schwartz' general theory of distributions put all into a safe framework.
But, yes, there are possible gradations of generalized functions, and this is often neglected in first introductions. You might also see the Gelfand-et-al series of books "Generalized Functions", where many, many examples are done.
