An inequality with Sobolev norm. Let $\Omega\subset\mathbb{R}^{n}$ be a smoothly bounded
domain. Is the following statement true? 
There exists a positive constant $C$ such that 
$$
\intop_{\Omega}\dfrac{\left|f\left(x\right)\right|^{2}}{\delta\left(x\right)}dx\leq C\left\Vert f\right\Vert^{2} _{W^{1,2}},
$$
for any $f\in C_{c}^{\infty}\left(\Omega\right)$. Here $\delta\left(x\right)$
denotes the distance from $x$ to the boundary of $\Omega$.
 A: This is known as Hardy's inequality, see, e.g., math.aalto.fi/~jkkinnun/papers/mrl.pdf
A: You can model your domain $\Omega$ by the half-space $\{(x', x_n)\mid x_n\ge 0\}$, so that the boundary is $\mathbb{R}^{n-1}$; don't worry too much about the boundedness of $\Omega$. Since the problem is the boundary, assume that $f=x_n^{1/2}$, which is morally in $W^{1,2}$ if we redefine $f$ conveniently at infinity. Testing agains $f$, I'd expect the the inequality holds morally with $\delta^2$ instead of $\delta$. With this heuristics, let's try to sketch a rigorous argument.
By a partition of unity and a convenient transformation of variables, assuming that the boundary is smooth, we reduce to the inequality
$$\iint_{\{x_n\ge 0\}} \frac{|f|^2}{x_n^{2-\epsilon}}\varphi\,dx_ndx\le C_{\epsilon}\lVert f\rVert^2_{W^{1,2}},$$
where $\varphi$ is a smooth function vanishing outside $B_1=\{|x|\le 1\}$ and $C_{\epsilon}$ depends on $\epsilon>0$. Write $\alpha = -2+\epsilon$, hence after an integration by  parts
$$\frac{1}{1+\alpha}\int_{\{x_n\ge 0\}} \partial_nx_n^{1+\alpha}|f|^2\varphi\,dx_n= \frac{-1}{1+\alpha}\int_{\{x_n\ge 0\}}  x_n^{1+\alpha}(\varphi f\partial_n \bar{f}+\varphi\bar{f}\partial_n f+|f|^2\partial_n\varphi).$$
I have used here that $f$ vanishes near the boundary. To avoid problems, suppose without extreme lack of rigurosity that $\partial_n\varphi=0$ near the boundary. By Cauchy-Schwarz we get
$$\begin{multline}\Big|\int_{\{x_n\ge 0\}} x_n^{\alpha}|f|^2\varphi\,dx_n\Big|\le C\Big[\Big(\int x_n^{\alpha_1}|f|^2\varphi\,dx_n\Big)^{1/2}\Big(\int |\partial_n f|^2\varphi\,dx_n\Big)^{1/2}+\\ 
+\int |f|^2|\partial_n\varphi|\,dx_n\Big],
\end{multline}$$
where we define the new constant $\alpha_1=2(1+\alpha)$. You can iterate the argument and use Young's inequality $2xy\le x^2+y^2$ until $\alpha_{n+1}=2(1+\alpha_n)>0$, which is possible because $\alpha>-2$, so that you can eliminate $x_n^{\alpha_{n+1}}$ by the supremum norm. Avoid any $\alpha$ for which $\alpha_n=-1$ for some $n$.
I don't like too much this argument, the control on the constant $C_{\epsilon}$ is rather poor, but at least it gives you confidence about the result. I hadn't seen this inequality, but it looks standard so it's possible that you can find it already in the literature with a good proof. I think that better proofs and stronger results are quite possible.  The inequality looks similar to the Schauder interior estimates.
EDIT: After watching the link posted by daw in the comments, I have realized that my answer is empty. It is Hardy's inequality.
