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$$
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.