Riesz Representation Theorem and Inner Products I am running into some confusion:
Suppose in Quantum Mechanics we think of the ket $|x \rangle $ as being an improper state - one not "actually" in the Hilbert space, but which is useful to nonetheless think of as forming a complete set of basis vectors.
We write $\langle x | \Psi \rangle = \Psi (x)$ as a way of saying that this is the "coefficient" of $\Psi$ at $x$.
But $\langle x|$ is a continuous linear functional, and so by the Riesz representation theorem we should be able to represent it as some actual ket.
On the other hand, if we think of $|x \rangle$ as "actually" being allowed in the Hilbert space,
then $\langle x | x \rangle = \delta(x-x)=\delta(0) = \infty$ which is not consistent either. What is actually going on here?
 A: No, $\langle x|$ is not $L^2$ continuous so that the Riesz theorem does not apply. Actually it is not even a functional on that space since the vectors are equivalence classes up to zero Lebesgue measure sets and $\{x\}$ has zero measure.
ADDENDUM.
The Hilbert space $L^2(\mathbb{R}^n, d^nx)$, referred to the Lebesgue measure on $\mathbb{R}^n$ is made of equivalence classes of functions
$$[f] := \{g: \mathbb{R}^n \to \mathbb{C}\:|\: f-g=0 \quad \mbox{on a zero-measure set}\}$$
and obviusly $[f] \in L^2(\mathbb{R}^n, d^nx)$ if and only if
$$\int_{\mathbb{R}^n}|f(x)|^2 d^nx < +\infty$$
and one easily sees that this condition is valid for every $g\in [f]$.
The vector space strucuture is constructed in a natural way:
$$a[f]+b[h] = [af+bh]\:.$$
However, sometimes it is possible to uniquely identify $[f]$ with some $g\in [f]$. This happens when there is a continuous element in $[f]$.
Proposition.  If $g\in [f] \in L^2(\mathbb{R}^n, d^nx)$ is continuous then it is unique in $[f]$.
That is the reason why we can define differential operators on suitable subspaces $L^2(\mathbb{R}^n, d^nx)$: these subspaces are such that every element contains a (necessarily unique!) continuous (and for instance differentiable) element and the definition of the operator is therefore given on those representatives.
The (continuous) dual space of a Hilbert space $H$ is defined that way
$$H' := \{\alpha : H \to \mathbb{C}\:|\: \alpha \quad \mbox{linear and continuos}\}\:.$$
Continuous is here referred to the natural topology of $H$. It means that,
when $v_n,  v\in H$,
$$|\alpha(v_n)- \alpha(v)| \to 0 \quad \mbox{if, for $n \to +\infty$,}  \quad ||v_n-v|| \to 0\:.$$
The norm is the one generated by the Hermitian scalar product $\langle\cdot|\cdot\rangle$ on $H$
$$||v|| := \sqrt{\langle v|v\rangle}\:,\quad v \in H\:.$$
It is easy to prove that $H'$ is a complex vector space as well with natural linear structure
$$(a\alpha+ \beta b)(v) := a\alpha(v) + b \beta(v)\:, \quad a,b \in \mathbb{C}\:, \alpha,\beta \in H'\:, v\in H\:.$$
Riesz' lemma in now like this.
Riesz' lemma. If $H$ is a complex Hilbert space with hermitian scalar product $\langle\cdot|\cdot\rangle$, then $H'$ is anti isomorphic to $H$ as a complex vector space. In other words, the antilinear map
$$H \ni v \mapsto \langle v| \cdot \rangle \in H'$$
is bijective.
Let us come to the main issues.
Formally speaking, if $x\in \mathbb{R}^n$ and $[\psi] \in L^2(\mathbb{R}^n, d^nx)$,
$$\langle x | \psi \rangle := \psi(x)\:.\tag{1}$$
You see that, as it stands, this definition is absolutely  meaningless! That is because $\{x\}$ has zero measure, so that  we can change the value of $\psi$ exactly at $x$ remaining in the same class $[\psi]$, i.e.,keeping the same element of the Hilbert space.
A fortiori it does not make any sense to investigate if $\langle x| \in H'$.
The way out consists  of  restricting the domain of $\langle x|$ to a subspace whose elements includes continuous functions and exploiting the proposition above.
Apparently this subspace is nothing but
$$C := \left\{[\psi] \:\left|\: \psi: \mathbb{R}^n \to \mathbb{C}\quad  \mbox{is continuous and}\quad  \int_{\mathbb{R}^n}|f(x)|^2 d^nx < +\infty\right.\right\}$$
In view of the proposition above, the definition (1) is now meaningful when restricting the domain of $\langle x|$ to the dense linear subspace $C$.
However, again, it does not make sense to discuss whether ot not $\langle x| \in H'$, since the elements of $H'$ are defined on the whole $H$ contrarily to $\langle x|$.
In any cases, it is not difficult to prove that $\langle x|$ is not continuos with respect to the natural topology of $H$ restricted to $C$.
Things dramatically change if we further restrict $C$ to the Schwartz space $\cal{S}(\mathbb{R}^n)$, more properly to the subspace of the Hilbert space induced by the Schwartz functions.
In that case, it turns out that $\langle x|$ is continuous with respect to the natural topology of that space (that is not a normed topology). The found space of continuous functionals is known as the space $\cal{S}'(\mathbb{R}^n)$ of Schwartz distributions.
Since the  Hilbert space topology implies Schwartz-continuity, we have the (topological) inclusions
$$\cal{S}(\mathbb{R}^n) \subset H = H' \subset \cal{S}'(\mathbb{R}^n)\:.$$
That structure is (was) the starting point for Gelfand and coworkers to build up a rigorous theory of formal bras $\langle x|$ and $\langle p|$ and, more generally, an alternative approach to the spectral theory.
(I dislike Gelfand's approach since I find it  unnecessarily mathematically cumbersome with respect to the elegant and much more general von Neumann's construction, even if I admit that it is very effective in physical computations and I use it in formal computations.)
A: Well, while "$\langle x|$ is a continuous linear functional" is a true statement, you have to know some subtleties why you cannot draw a conclusion about it from the Riesz (or Fischer-Riesz) representation theorem. The latter is valid for a Hilbert space with a unique scalar product and its metric topology. $\langle x|$ is a continous linear functional not with respect to the metric topology of the Hilbert space (of $ L^2 (\mathbb R)$, to be precise), but with a different topology defined only on a (dense everywhere) subset of $ L^2 (\mathbb R)$. These topologies can be shown to be non-equivalent, so "$\langle x|$ is a continuous linear functional, therefore by Riesz theorem...” contains a non sequitur.
