Let $E\subseteq \mathbb{R}$ be a Lebesgue measurable set. Define $$f(x)=\operatorname{dist}(x,E)=\inf\{|x-e| \ : \ e\in E\}. $$ I want to prove that for almost every $x\in E$ that $$\lim_{r\rightarrow 0^+}\frac{f(x+r)}{r}=0. $$
What I've Tried: This looks very much like the right derivative at $x$. Noting that if $x\in E$ then $f(x)=0$ and thus $$\lim_{r\rightarrow 0^+} \frac{f(x+r)-f(x)}{r}= \lim_{r\rightarrow 0^+}\frac{f(x+r)}{r}. $$ But I really don't know how to proceed from here... If $x\in \operatorname{Int}(E)$ then the limit should exist, so it seems we only need to worry about points in $E-\operatorname{Int}(E)$.
Since $|f(x)-f(y)|\leq |x-y|$, $f$ is of bounded variation. Hence, $f$ is differentiable almost everywhere. Now, since $f$ is nonnegative and $f=0$ on $E$, for each point $x\in E$, $f$ has a local minimum at $x$. Thus, at every point $x\in E$ at which $f$ is diffetentiable, $f'(x)=0$.