A density argument in the proof of Hardy's inequality for $H^1(\mathbb R^3)$ I understand $C^{\infty}_0 (\mathbb{R}^3)$ is dense in $H^1 (\mathbb{R}^3)$.
But I don't understand the reason it is enough to prove the following Hardy inequality if you prove the case $u \in C^{\infty}_0$.
(Hardy inequality) Let$ \ u \in H^1 (\mathbb{R}^3)$. Then,
$$\int_{\mathbb{R}^3} \frac{|u(x)|^2}{|x|^2} dx \leq 4\int_{\mathbb{R}^3} |\nabla u(x)|^2 dx$$
 A: The reason is that both sides of the inequality are continuous with respect to the $H^1$ norm. When you have two continuous function $f,g$ on some space, and $f\le g$ holds on a dense subset, then it follows that $f\le g$ everywhere. 
The continuity of $u\mapsto \int_{\mathbb{R}^3} |\nabla u(x)|^2 dx$ is immediate from the definition of $H^1$ norm. 
Let $B$ be the unit ball of $\mathbb{R}^3$. The continuity of $u\mapsto \int_{\mathbb{R}^3\setminus B} \frac{|u(x)|^2}{|x|^2} dx$ also follows quickly, since $1/|x|^2$ is bounded on $\mathbb{R}^3\setminus B$.
To deal with $u\mapsto \int_{B} \frac{|u(x)|^2}{|x|^2} dx$, we need the Sobolev inequality: $H^1(B)$ embeds into $L^6(B)$, therefore $|u|^2\in L^3(B)$. The function $x\mapsto 1/|x|^2$ belongs to $L^{4/3}(B)$,  and therefore defines a continuous functional on $L^3(B)$ (Hölder's inequality). The conclusion follows.  
A: Let $B_r$ be the ball with radius $r$.
If $u_n\in C_0^{\infty}$ is an approximation of $u$ in $H^1(\mathbb{R}^3)$, we have
\begin{align}
  \left|\left\lVert \frac{u_n}{|x|}\right\rVert_{L^2(\mathbb{R}^3\setminus B_r)}
  -\left\lVert \frac{u}{|x|}\right\rVert_{L^2(\mathbb{R}^3\setminus B_r)}\right|
  &\le \left\lVert \frac{u_n-u}{|x|}\right\rVert_{L^2(\mathbb{R}^3\setminus B_r)}
  \le \frac{\lVert u_n-u\rVert_{L^2(\mathbb{R}^3\setminus B_r)}}{r}\\
  &\le \frac{\lVert u_n-u\rVert_{L^2(\mathbb{R}^3)}}{r}\to 0.
\end{align}
Since we have
\begin{equation}
  \left\lVert \frac{u_n}{|x|}\right\rVert_{L^2(\mathbb{R}^3\setminus B_r)}
  \le \left\lVert \frac{u_n}{|x|}\right\rVert_{L^2(\mathbb{R}^3)}
  \le 2\lVert \nabla{u_n}\rVert_{L^2(\mathbb{R}^3)},
\end{equation}
we get
\begin{equation}
  \left\lVert \frac{u}{|x|}\right\rVert_{L^2(\mathbb{R}^3\setminus B_r)}
  \le 2\lVert \nabla{u}\rVert_{L^2(\mathbb{R}^3)}
\end{equation}
as $n\to\infty$. Taking limit $r\to 0$ we complete the proof. Sobolev inequality is not necessary.
