If $\nabla u\in L^2(\mathbb{R}^n)$, then $u\in L^2_{loc}(\mathbb{R}^n)$ Suppose $u\in D'(\mathbb{R}^n)$ (i.e., $u$ is a distribution) can be identified with a weakly differentiable function such that $\nabla u\in L^2(\mathbb{R}^n)$.  Show that $u\in L^2_{loc}(\mathbb{R}^n)$.
It should be straightforward, but I run into this problem: I'm aiming to use 
$$||u||_{L^2(\Omega)} = sup_{\phi\in L^2, \, ||\phi||=1} \int u \phi,$$
where $\Omega$ is any compact set.  I start with
$$\bigg| \int u \phi_{x_i} \bigg| = \bigg| \int u_{x_i} \phi\bigg| \le ||\nabla u||_{L^2(\Omega)} ||\phi||_{L^2(\Omega)}.$$
for $\phi \in C_c^\infty(\Omega)$.  But I don't think such functions ($\phi_{x_i}$) are dense in $L^2(\Omega)$, so I don't see how to finish the argument.
 A: It suffices to show that there exists a constant $C(\Omega)$ such that for every $\varphi\in C_C^{\infty}(\Omega)$ there exists $\phi\in C_C^{\infty}(\mathbb{R}^n)$ such that $\phi_{x_i} = \varphi$ in $\Omega$ and $\|\phi\|_{L^2(\Omega}\le C(\Omega)\|\varphi\|_{L^2(\Omega)}$. Let $f(x,x_i) = \int\limits_{-\infty}^{x_i}{\varphi(x,s)\text{ d}s}$, where $x$ stands for all of the coordinates except $x_i$. Let $\rho$ be some cut-off function on $\Omega$, i.e. $\rho\in C_C^{\infty}(\mathbb{R}^n)$ and $\rho\equiv 1$ in $\Omega$. Let $\phi = f\rho$. Then $\phi\in C_C^{\infty}(\mathbb{R}^n)$, $\phi = f$ in $\Omega$ (implying that $\|\phi\|_{L^2(\Omega)} = \|f\|_{L^2(\Omega)}$), and $\phi_{x_i} = \varphi$ in $\Omega$. We now just have to bound $\|f\|_{L^2(\Omega)}$. Let $d = \text{diam}(\Omega)$, and for $x\in\mathbb{R}^{n-1}$ let $\Omega_x = \{x_i\in\mathbb{R}:(x,x_i)\in\Omega\}$. Then $\varphi\in C_C^{\infty}(\Omega)$ implies that $|\text{supp}(s\mapsto\varphi(x,s))|\le |\Omega_x|\le d$, and hence Cauchy-Schwarz yields
$$|f(x,x_i)|^2 \le\left(\int\limits_{\Omega_x}{|\varphi(x,s)|\text{ d}s}\right)^2\le |\Omega_x|\int\limits_{\Omega_x}{|\varphi(x,s)|^2\text{ d}s}\le d\int\limits_{\Omega_x}{|\varphi(x,s)|^2\text{ d}s}. $$
Furthermore, we have
$$ \int\limits_{\Omega_x}{|f(x,x_i)|^2\text{ d}x_i}\le|\Omega_x|\sup\limits_{x_i\in\Omega_x}{|f(x,x_i)|^2}\le d^2\int\limits_{\Omega_x}{|\varphi(x,s)|^2\text{ d}s} $$
We thus have
$$ \|f\|_{L^2(\Omega)}^2 = \int\limits_{\Omega}{|f|^2} = \int\limits_{\mathbb{R}^{n-1}}\int\limits_{\Omega_x}{|f(x,x_i)|^2\text{ d}x_i\text{ d}x}\le d^2\int\limits_{\mathbb{R}^{n-1}}\int\limits_{\Omega_x}{|\varphi(x,s)|^2\text{ d}s\text{ d}x} = d^2\|\varphi\|_{L^2(\Omega)}^2$$
Hence, $\|\phi\|_{L^2(\Omega)} = \|f\|_{L^2(\Omega)}\le d\|\varphi\|_{L^2(\Omega)}$. This is enough to prove your problem, since for any $\varphi\in C_C^{\infty}(\Omega)$ we would have
$$ \left|\int\limits_{\Omega}{u\varphi}\right| = \left|\int\limits_{\Omega}{u\phi_{x_i}}\right|\le\|\nabla u\|_{L^2(\Omega)}\|\phi\|_{L^2(\Omega)}\le d\|\nabla u\|_{L^2(\Omega)}\|\varphi\|_{L^2(\Omega)}.$$
