Any idea on how to show that for a function $f\in H^1(\mathbb{R}^3 )$ the following inequality holds
$$\int_{ \mathbb{R}^3} \frac{f^2}{|x|^2}dx\le 4\int_{\mathbb{R}^3} |\nabla f|^2 dx$$? The integral looks singular (not bounded) at the origin of $\mathbb{R}^3 $. I wonder if this inequality could hold even in $\mathbb{R}^n$.
This is Hardy's Inequality. You may consider first for a $f \in C_c^1(\mathbb{R}^n)$ (where, $n \ge 3$) and apply integration by parts as follows, \begin{align} (n-2)\int_{\mathbb{R}^n} \frac{f^2}{|x|^2} \,dx = \int_{\mathbb{R}^n} f^2\operatorname{div}\left(\frac{x}{|x|^{2}}\right)\,dx &= -2\int_{\mathbb{R}^n} \frac{(x\cdot \nabla f)f}{|x|^{2}}\,dx \tag{1}\\& \le 2\left(\int_{\mathbb{R^n}} |\nabla f|^2\,dx\right)^{1/2}\left(\int_{\mathbb{R^n}} \frac{f^2}{|x|^2}\,dx\right)^{1/2} \tag{2}\end{align} where, in line $(2)$ we used the Cauchy-Schwarz Inequality. Therefore, we have $$\left(\frac{n-2}{2}\right)^2\int_{\mathbb{R}^n} \frac{f^2}{|x|^2} \,dx \le \int_{\mathbb{R^n}} |\nabla f|^2\,dx.$$
Then use the density of $C_c^1$ in the class of Sobolev functions to extend the result to $H^1(\mathbb{R}^n)$.
N.B.: The singularity at origin is integrable for $n \ge 3$ (use polar coordinates).