On page 263 of Reed and Simon, book 1, in the formulation of the projection valued measure form of the spectral theorem, they make the following claim which I don't see why is true. That is, the following domain $$D_g = \{ \varphi \ \vert \ \int_{-\infty}^{\infty} \left| g(\lambda)\right|^2 d(\varphi, P_{\lambda}\varphi) < \infty \}$$ is dense.
Note that this is the unbounded, not the bounded case. That is, $g$ is an unbounded function.
Assume $|g(\lambda)| < \infty$ for all $\lambda$, without assuming that $g$ is bounded. Define an operator $T_g$ by $$ T_gx = \int |g(\lambda)|dP(\lambda)x,\;\;\; x\in D_g, $$ where $D_g$ is as you described in the problem statement. This makes sense because $$ \|T_gx\|^2 = \int |g(\lambda)|^2d(P(\lambda)x,x) < \infty,\;\;\; x\in D_g. $$ The operator $T_g$ is symmetric and non-negative on its domain, and satisfies $$ (T_g+I)\int \frac{1}{1+|g(\lambda)|}dP(\lambda)x = x,\;\; x\in H. $$ To prove $D_g$ is dense in $H$, suppose that $y\in H$ is orthogonal to $D_g$. Then $y=(T_g+I)x$ for some $x\in D_g$, which gives $$ 0 = (y,x)=((T_g+I)x,x) \ge (x,x) \ge 0 \\ \implies x= 0 \\ \implies y=(T_g+I)x=0. $$ Therefore $D_g^{\perp}=\{0\}$, which proves that $D_g$ is dense in $H$.