Exercise from Stein's Real Analysis Exercise 9 in chapter 3:
Let $F$ be a closed subset in $\mathbb{R}$, and $\delta(x)$ is the distance from $x$ to $F$, that is,
$$\delta(x)=\inf\{|x-y|:y\in F\}$$
Clearly, $\delta(x+y)\leq |y|$ whenever $x\in F$. Prove the more refined estimate
$$\delta(x+y)/|y|=o(|y|)$$
for a.e. $x\in F$.
That is $\delta(x+y)/|y|\rightarrow0$.
[Hint: Assume that $x$ is a poit of density of F].
My question is why set $F$ has to be a closed set? since I didn't use the this condition in my proof. 
My idea is like this:
Suppose $y>0$, let $I=[x,x+y]$.
If $\delta(x+y)\leq m(F^c\cap I)$, then
$$\frac{\delta(x+y)}{|y|}\leq \frac{m(F^c\cap I)}{|y|}=1-\frac{m(F\cap I)}{m(I)}\rightarrow0$$ 
Since for any $z\in F\cap I$, we must have
$$d(x+y,z)\geq \delta(x+y)$$
then there is an interval of length $\delta(x+y)$ that is an subset of $F^c\cap I$ .
 A: The hypothesis that $F$ is closed is not necessary. However, note that the distance from a set is the same as the distance from its closure. By passing from $F$ to its closure   we lose no generality, and in fact make a stronger statement because the estimate is claimed to hold a.e. on a larger set. 
One proof I like: the function $\delta$ is Lipschitz, therefore differentiable a.e. (it has bounded variation on finite intervals). In particular, it is differentiable at a.e. point of $F$. But  every point of $F$ is a point of minimum for $\delta$. So the derivative of $\delta$ is $0$ whenever it exists. 
If you want to argue in terms of density, I think it's easier to do the contrapositive. Namely, assume that there is a sequence $y_k\to 0$ such that $\delta(x+y_k)\ge \epsilon |y_k|$, with fixed $\epsilon>0$, and show that $F$ does not have density $1$ at $x$. Reason: there's a hole of size $2\epsilon |y_k|$ at $x+y_k$.   So, the intersection of $F$ with $[x-2|y_k|,x+2|y_k|]$ has measure at most $2|y_k|(1-\epsilon)$, which is not enough to have density $1$.
