What is a "continuous" Hilbert space? The book I'm reading about quantum mechanics uses the term "continuous" Hilbert space, whereby apparently in such a
space one has a "continuous" basis, e.g. $\{ |x\rangle \}_{x\in \mathbb{R}}$ and
every element $\left| \psi  \right\rangle $ in this space can then be written as
\begin{aligned}
\left| \psi \right\rangle  = \int_{-\infty}^{\infty} \psi ( x)\left| x\right\rangle \mathrm{~d}x 
\end{aligned}
where $\psi ( x)$ gives the component of $\left| \psi \right\rangle $ associated with the basis vector
$\left| x\right\rangle $. Unfortunately nothing of the above is ever defined and hence I'm wondering how
this is mathematically explained, i.e.

*

*What is a continuous hilbert space?

*How does one understand the above integral (since it's apparently not an ordinary Riemann integral)?

*When is the above integral well defined?

It would be great if someone could answer some of these questions or point me to the respective literature.
Thanks in advance!
Edit: The document I'm reading is from a lecture I'm attending, here the relevant part that introduces continuous Hilbert spaces:

Infinite continuous dimensions. A continuous space is used when we need to deal with physical systems that involve continuous variables (e.g. position in space):
$$
\mathcal{H}=\operatorname{span}\{|x\rangle\}_{x \in \mathbb{R}} \quad \ni \quad|\psi\rangle=\int_{\mathbb{R}} \psi(x)|x\rangle d x, \quad \int_{\mathbb{R}}|\psi(x)|^2 d x=1
$$
In both cases $|\psi\rangle$ is an arbitrary state of the system which can be expressed in terms of a basis of the Hilbert space. From now on we will assume that all the bases we use are orthonormal, it will be clear later why this is important.


The wave function.
We expressed a state $|\psi\rangle$ in terms of a basis of the Hilbert space of a system. Let us consider the continuous case (the discrete case is analogous):
$$
\psi=\int_{\mathbb{R}} \psi(x)|x\rangle d x
$$
where $\psi(x)$ is a function containing the components of the vector $|\psi\rangle$ with respect to the basis $\{|x\rangle\}$. It is called the wave function. Let us now compute the inner product $\langle x \mid \psi\rangle$ :
$$
\begin{aligned}
    \langle x \mid \psi\rangle &=\left\langle x\left|\int_{\mathbb{R}} \psi\left(x^{\prime}\right)\right| x^{\prime}\right\rangle d x^{\prime} \\
    &=\int_{\mathbb{R}} \psi\left(x^{\prime}\right)\left\langle x \mid x^{\prime}\right\rangle d x^{\prime} \\
    &=\int_{\mathbb{R}} \psi\left(x^{\prime}\right) \delta\left(x-x^{\prime}\right) d x^{\prime} \\
    &=\psi(x)
\end{aligned}
$$
where $\delta(x)$ is the Dirac delta function, and it follows from the fact that the basis
$\{|x\rangle\}_x$ is orthonormal. Therefore, the inner product of a state with a basis element yields the value of the wave function with respect to that particular element, i.e. the projection of $|\psi\rangle$ onto $|x\rangle$.

 A: The idea of a continuous basis comes from the Fourier transform:
$$
            f(x)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\hat{f}(s)e^{isx}ds,\\
          \hat{f}(s)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}f(x)e^{-isx}dx
$$
You're thinking of writing $f$ as an expansion in a "continuous basis" of eigenfunctions $e^{isx}$ of the differentiation operator $\frac{1}{i}\frac{d}{dx}$. This looks very much like a "continuous" versions of a discrete orthonormal basis expansion when you write
$$
        e_s(x)=\frac{e^{isx}}{\sqrt{2\pi}},
             \hat{f}(s)= \langle f,e_s\rangle,\;\;  \\
           f = \int_{-\infty}^{\infty}\langle f,e_s\rangle e_s ds.
$$
And it behaves in much the same way as a discrete expansion when it comes to the Parseval identity, too:
$$
           \|f\|^2 = \int_{-\infty}^{\infty}|\langle f,e_s\rangle|^2ds
$$
These $e_s$ are "eigenfunctions" of the differentiation operator $D=\frac{1}{i}\frac{d}{dx}$ with eigenvalue $s$:
$$
            D e_s = s e_s
$$
This is so close to a discrete eigenfunction expansion for a self-adjoint operator that our brains just crave a way to see it using an analogous formalism. And ... in many ways you can force that square peg into the round hole. But sometimes the desire to do that lazy thing makes everything more difficult than simply understanding each on its own.
Ralph Waldo Emerson: “A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. He may as well concern himself with his shadow on the wall."
