I am trying to do the below question and I have been able to prove that if $\phi (x) \in L^2(\mathbb R)$ and $x\phi (x) \in L^1(\mathbb R)$ then $\phi$ is square integrable $\iff \int \phi(x)dx=0$.
The step that I'm missing is that if a function, $\phi (x)$, has compact support and is in $L^2(\mathbb R)$, then $x\phi (x) \in L^1(\mathbb R)$. The question:

Just apply Holder's inequality on the support of $\phi$. $$\int_{\mathbb{R}}|x\phi|\,dx\le L\int_{-L}^L|\phi|\,dx\le L(2L)^{1/2}\Vert\phi\Vert_{L^2}<\infty,$$ where $\phi=0$ outside $[-L,L]$.