Suppose $F$ is a closed set in $\mathbb{R}$, whose complement has finite measure, and let $\delta(x)$ denote the distance from a point $x$ to $F$. That is, $$ \delta(x) = \inf\{|x-y|: y\in{F}\} $$ Now, let $$I(x) = \int_{\mathbb{R}} \frac{\delta(y)}{|x-y|^2} dy$$ Show that for every $x\notin{F}$, $I(x) = \infty$ Furthermore, show that for every almost every $x\in{F}$ we have that $I(x) < \infty$. My attempts so far for the first one is the following: $$I(x) = \int_{\mathbb{R}} \frac{\delta(y)}{|x-y|^2} dy = \int_{F} \frac{\delta(y)}{|x-y|^2}dy + \int_{\mathbb{R}-F} \frac{\delta(y)}{|x-y|^2}dy $$ And the first integral on the right hand side is zero, since for any $y\in{F}$, $\delta(y) = 0$. This leaves us with just $$\int_{\mathbb{R}} \frac{\delta(y)}{|x-y|^2}dy = \int_{\mathbb{R}-F} \frac{\delta(y)}{|x-y|^2}dy$$ But, I've shown that $\delta(x)$ is continuous, and in particular, it's a Lipschitz function. That is, $|\delta(x) - \delta(y)| < |x - y|$. So, we have that $$\int_{\mathbb{R}-F} \frac{\delta(y)}{|\delta(x)-\delta(y)|^2}dy < \int_{\mathbb{R}-F} \frac{\delta(y)}{|x-y|^2}dy $$ This is as far as I've been able to take my estimations for the first part where $x\notin{F}$.
For the second part, where $x\in{F}$, I have that $$ \int_{\mathbb{R}-F} \frac{\delta(y)}{|x-y|^2}dy < \int_{\mathbb{R}-F} \frac{\ |x-y|}{|x-y|^2}dy < \int_{\mathbb{R}-F} \frac{1}{|x-y|}dy $$
I'm less sure about this last estimation. Anyhow, I'm stuck. Any suggestions on where to go from here?