How do the balls maximizing the maximal function depend on their centers? Let $\mu$ be a finite Borel measure on $\mathbb R^N$ and let $f\in L^1(\mu)$ be a non-negative function. Let $M_\mu f$ denote the maximal function of $f$ relative to $\mu$, i.e. $(M_\mu f)(x)=0$ if $\mu(B(x,r))=0$ for some $r>0$ and $(M_\mu f)(x) = \sup_{0<r<\infty} \frac{1}{\mu(B(x,r))} \int_{B(x,r)}f \, d\mu$ otherwise. (Here $B(x,r)$ denotes the open ball of radius $r$ centered at $x$.)
Suppose that $a>0$ and $K\subset \mathbb R^N$ is a compact such that $M_\mu f > a$ on $K$. Then for each $x\in K$ there exists $r_x>0$ such that $$\frac{1}{\mu(B(x,r_x))} \int_{B(x,r_x)}f \, d\mu > a. \tag{1}$$
Question. Is it possible to choose for each $x\in K$ the radius $r_x>0$ in such a way that (1) holds and the mapping $x\mapsto r_x$ is continuous, or upper semicontinuous, or at least Borel?
This question is inspired by another recent question about Besicovich type covering theorem.
 A: The selection can be made lower or upper semicontinuous.
Consider any $x\in K$ and $r>0$ such that
$$f_r(x):=\frac{1}{\mu(B(x,r))}\int\limits_{B(x,r)}f d\mu>a.$$
For any fixed $d\in(0,\tfrac{r}{2})$ and for any $y\in B(x,d)$ we have $B(x,r-2d)\subset B(y,r-d)\subset B(x,r)$. Therefore for any $x\in K$ and any $y\in K\cap B(x,d)$
$$f_{r-d}(y)=\frac{1}{\mu(B(y,r-d))}\int\limits_{B(y,r-d)} fd\mu\geq \frac{1}{\mu(B(x,r))}\int\limits_{B(x,r-2d)} fd\mu >a$$
if $d$ is small enough (say if $0<d\leq d_x<\tfrac{r}{2}$) just by the monotone convergence of the last integral. This means that for every $x\in K$ there exist $r_x$ and $0<d_x<\tfrac{r_x}{2}$ such that 
$$f_{r_x-d_x}(y)>a\quad\text{ for every }y\in B(x,d_x)\cap K.$$
By compactness we can cover $K$ with a finite numer of balls $B_i=B(x_i,d_{i})$. Then any selection of the radii $r_{i}-d_{i}$ will work. In particular for every $y\in K$ we can take 
$$r(y):=\max_i\{r_{i}-d_{i}:y\in B_i\}=\max_i (r_i-d_i) \chi_{B_i}(y)$$
which gives a lower semicontinuous function (supremum of l.s.c. is l.s.c.). Choosing instead the minimum (and considering closed balls $\overline{B(x,d_x)}$ in the argument above) gives an upper semicontinuous function. Actually now that I think about it it's not necessary to extract a finite subfamily...in any case this choice gives even an essentially locally constant function.
I don't know about a continuous selection.
