This is an exercise from my last homework sheet, proofing that $P$ is unbounded and self-adjoint was clear, however I'm having trouble proofing that $P$ is densely defined.
How my Instructor solved the problem:
Suppose we have the function $f_n(x)=\begin{cases} 1 & x\in \,[-n,n] \\ 0 & x\notin \,[-n,n] \end{cases}$
It is easy to show that $f_n(x)\in D_P$
If we take an arbitrary function $f(x)\in D_P$ we can show for all $n\in \mathbb{N}$ that:
$f(x)f_n(x)\in D_P$
$\lim_{n\to\infty}(f(x), f_n(x))=f(x)$
I can proof the individual steps, but I don't understand how this has to do anything with $D_P$ being dense?
How I tried to approach the problem:
We know that $P$ is densely defined if $(D_P)^\perp=\{0\}$
If we consider an arbitrary function $f(x) \in D_P$, we know that $\langle f(x), 0 \rangle=0$.
But is this the only function that is orthogonal to $D_P$?
For that I'm setting $f(x)=e^{-x^2}$, which is inside of $D_P$ since the Gaussian Integral converges.
We can see that the only function $g(x)$ that fullfills following equation is $0$, since there is no other $g(x)$ that would make the integralkernel equal to $0$ (I'm using the fact that the sgn$(x)$ function is not in $D_P$):
$0\stackrel{!}{=}\langle e^{-x^2}, g(x) \rangle = \int_{-\infty}^{\infty} e^{-x^2} g(x) dx$
Hence $0$ is the only function, orthogonal to every $f(x)\in D_P$.
I'm not really satisfied with either one of these solutions, and I hope someone could explain what the idea behind the first solution was, if my solution is correct, and if there are alternative\easier solutions. Thanks in advance.

The properties $$f(x)f_n(x)\in D_P\quad \lim_{n\to\infty}\|f(x) f_n(x)-f(x)\|_2=0$$ hold for any $f\in L^2(\Bbb{R})$, not just for $f\in D_P$. Therefore, any $f\in L^2(\Bbb{R})$ is a limit of a sequence of functions in $D_P$, so $D_P$ is dense.