I've been asked to prove (or find a counterexample) that the quantity $$Q(\alpha)=\int_B |f(x) - \alpha| \, dx$$ is always minimal when $\alpha=\bar{\alpha} = \frac{1}{|B|} \int_B f(x) \, dx$ ($|\cdot|$ is the Lebesgue measure), where $f \in L^1 _{\text{loc}}(\mathbb{R}^n)$ and $B$ is a fixed ball.
Actually I couldn't say so much. I've just noticed that the function $Q : \mathbb{R} \to \mathbb{R}$ is Lipschitz continuous with $\text{Lip}(Q) \le |B|$; moreover using the triangle inequality and the reverse triangle inequality I've obtained that $$\left|\int_B |f(x) - \gamma | \, dx - \int_B |f(x) -\bar{\alpha}| \, dx \right| \le \int_B |f(x) - \gamma | \, dx $$which leads to $$ \int_B |f(x) -\bar{\alpha}| \, dx \le 2 \int_B |f(x) - \gamma | \, dx \quad \forall \, \gamma \in \mathbb{R}. $$ Furthermore in a compact $K\subset \mathbb{R}$ such that $\bar{\alpha} \in K$ we would have $$ \int_B |f(x) - \gamma_{\min} | \, dx \le \int_B |f(x) -\bar{\alpha}| \, dx \le 2 \int_B |f(x) - \gamma_{\min} | \, dx. $$
I weakly suspect that this can be proved, but I couldn't do anything more.
Do you have any idea/hint?