Q: Prove this function is $\mathcal{B}(\mathbb{R}^d)$ measurable Let $f(x) = \sup_{r>0} \frac{\mu(B_r(x))}{m(B_r(x))}$. Prove it is $\mathcal{B}(\mathbb{R}^d)$ measurable. $\mu$ is a measure on  $\mathcal{B}(\mathbb{R}^d)$ such that $\mu(\mathcal{B}(\mathbb{R}^d))$ is finite, and $m$ is the Lebesgue measure.
My thoughts: suppose $x \in {f<a}$, then there exists $\epsilon$ s.t. $(1+\epsilon)f(x) <a$. So given some $\delta>0$ for any $x' \in B_{\delta}(x)$ we have
$\frac{\mu(B_r(x'))}{m(B_r(x'))}\leq \frac{\mu(B_{r+\delta}(x))}{m(B_r(x'))} = \frac{\mu(B_{r+\delta}(x))}{m(B_r(x))} = \frac{\mu(B_{r+\delta}(x))}{m(B_{r+\delta}(x))}(\frac{r+\delta}{r})^d \leq f(x)(\frac{r+\delta}{r})^d$
but I need $\delta$ to be uniform in order to prove $\{f<a\}$ is open and I don't know how to treat it when $r$ is very small.

A: Fix an $r>0$.
\begin{align*}
x\rightarrow\dfrac{\mu(B_{r}(x))}{m(B_{r}(x))}
\end{align*}
is a lower semi-continuous function. Then, $f$ as the supremum of a class of lower semi-continuous functions, is still a lower semi-continuous function, and hence a Borel function.
