Multiplication operator that is not self-adjoint Consider the multiplication operator $A \colon D(A) \to L^2(\mathbb R)$ defined by 
$$\forall f \in D(A): \quad(Af)(x) = (1+\lvert x \rvert^2)f(x),$$
where $$D(A) := \left \{f\in L^2(\mathbb R): (1+\lvert x \rvert^2)f\in L^2(\mathbb R), \int_\mathbb R f(x) \, dx = 0\right \}.$$
I want to show that $A$ is densely defined, symmetric and closed, but not self-adjoint. However I am struggling at some places.
Proof. Since $x\mapsto (1+\lvert x \rvert^2)$ is real-valued, $A$ is symmetric. Now let $(g_n)_{n\in \mathbb N} \subseteq L^2(\mathbb R)$ converging in $\lVert \cdot \rVert_{L^2(\mathbb R)}$ to some $g \in L^2(\mathbb R)$ and $Ag_n \to h \in L^2(\mathbb R)$. Passing to a subsequence we see that 
$$g_n(x) \to g(x), \quad (1+\lvert x \vert^2)g_n(x) \to h(x)$$
for almost every $x\in \mathbb R$, from which we see that $$g(x) = \frac{h(x)}{1+\lvert x \rvert^2}$$
for almost every $x\in \mathbb R$. Also since $g_n \to g$ in $L^1(\mathbb R)$ we have $$\int_{\mathbb R} g(x) \, dx = \lim_{n\to \infty} \int_{\mathbb R} g_n(x) \, dx = 0,$$
so $g\in D(A), Ag = h$ and $A$ is closed. Now consider the function $f(x) = e^{-x^2}$. Then letting $\psi_f(x) = (1+\lvert x \rvert^2) f(x)$ we have $ \psi_f \in L^2(\mathbb R)$ and for each $g\in D(A):$
$$\langle f, Ag \rangle_{L^2} = \langle \psi_f, g \rangle_{L^2},$$
so $f\in D(A^*)$. But since $\int_{\mathbb R} f(x) \, dx = \pi, f \notin D(A)$ and hence $A$ is not self-adjoint.
Is this correct so far? Also, I struggled showing $A$ is densely defined. It was hard for me to construct a approximating sequence under the constraint that the integral should vanish, also I could not compute the orthogonal complement. Any hints?
 A: For density, there is a useful fact, but I think it must be of somewhat overkilled, an easier argument should be ready:

The set of all Schwarz functions whose Fourier transforms have supports away from the origin is dense in $L^{p}(\mathbb{R}^{n})$.

Note that $\displaystyle\int_{\mathbb{R}^{n}}f(x)dx=\widehat{f}(0)$, so it is required that $\widehat{f}(0)=0$.
A: First, yes, I think your example of something in the domain of the adjoint but not in the domain of the operator is good to show the non-self-adjointness.
The other part is not hard, but maybe somehow is not well known:
Claim: let $D\subset V$ be a dense subspace, with a strictly finer topology than the subspace topology from $V$. Let $\theta$ be in the continuous dual of $D$, but not in the continuous dual of $V$. Then the kernel of $\theta$ on $D$ is still dense in $V$. 
Proof: since $\theta$ does not give a continuous linear functional on $V$, by
density of $D$ in $V$, for every $\epsilon > 0$ there is $x(\epsilon)
\in D$ such that $|x(\epsilon)|_V < \epsilon$ while $\theta\big( x(\epsilon)\big)
= 1$.  For every $v\in V$, there is a sequence $x_n\in D$ with $x_n\to
v$ in the $V$-topology.  If already $\theta x_n =0$ for
infinitely-many $x_n$, then that subsequence is in $\ker\theta$, as
desired. So without loss of generality suppose that $\theta x_n \not=
0$ for all $n$. Then $y_n=x_n−\theta \Big(x_n·x\big({1\over n·\theta
x_n}\big)\Big)$ is in $\ker( \theta|_D)$, and still $y_n \to v$ in $ V$. ///
