I am actually a physics student.
The definition of self adjoint operators which I have studied is
Definition. A densely defined $A: D_A \rightarrow \mathcal{H}$ is self adjoint if it coincides with its adjoint, where the adjoint is given by $$D_{A^*} = \{\psi \in \mathcal{H}|\exists \eta \;\forall \alpha \in D_A: \langle \psi, A\alpha\rangle = \langle \eta, \alpha\rangle \}$$ and $A^* \psi = \eta$
This suggests to me that the underlying space $\mathcal{H}$ needs to be a Hilbert space, necessarily, since
(i) the domain lies dense in $\mathcal{H}$ (thus we need complete space (?))
(ii) The definition uses inner product structure
Is this true, or can we still define them on incomplete spaces? The reason I ask this is, suppose I see a random differential equation (excuse me for the typical physics notation) $$D_x f(x) = g(x);\; x\in (a,b)$$ Given nothing more, the reference I use says $$\int_a^b dx |x\rangle\langle x| = 1$$ which is actually analogue of something like integration over projection valued measure (of some self adjoint operator) $$\int_\mathbb{R} dP = id_{\mathcal{H}}$$
According to my knowledge, if we can't define self adjoint operators (here, projection valued measure) without Hilbert space structure, this cannot be done. And if indeed this is to be true, $g \in L^2(a,b)$ and differential operator must be defined on domain of $L^2$.
Can you tell whether I am right or wrong( and why?)