this is a question where I am trying to find a reference for a result but I haven't been able to find one at all.
Define $L_2(\mathbb R,d\mu) = \{g\in \mathbb R: \int g^2d\mu <\infty\}$. I am trying to find a reference on conditions on $d\mu$ for which $L_2(\mathbb R,d\mu)$ is a Hilbert space with defined inner product
$$ \begin{align*} \langle f,g\rangle = \int fg d\mu. \end{align*} $$
Any help in finding a textbook / paper / reference would be incredibly helpful!
This is true for any measure. See Rudin's Real and Complex Analysis Example 4.5(b) and the proofs referred to there. For any measure space $(X,d\mu)$, $L^2(X,d\mu)$ will always be a Hilbert space. Depending on the measure, it may not be separable, or it may be finite dimensional, but it will always be a Hilbert space.
(Also, the reference works with $\mathbb{C}$-valued functions, but the proofs for $\mathbb{R}$-valued functions are either identical or simpler).