The mean of $f$ minimizes $||f-\xi||_p$ over all $\xi\in\Bbb R$. [Reference request] I would like to know where I can find a reference for the following fact:

Let $\Omega$ be a set of finite measure, $1<p<\infty$ and $f\in L^p(\Omega,\mu)$. Denote $\bar f:=\frac 1{|\Omega|} \int_\Omega f d\mu$. Then
  $$
\bar f = \arg\min \{ ||f-\xi||_p :  \xi\in\Bbb R \}.
$$

For $p=2$ the result is extremely well-known whereas for $p=1$ the above doesn't hold.
I am surprise that I couldn't find a reference for the above result for a general $p>1$ since I assumed it to be somewhat well-known as well. Does anyone know a book where this theorem is stated?

This result only holds for $p = 2$. Indeed, if we denote
$$J(\xi) = \int_\Omega |f - \xi|^p \, \mathrm d\mu,$$
we get (at least formally)
$$J'(\xi) = \int_\Omega p \, |f - \xi|^{p-2} \, (f - \xi) \, \mathrm d\mu.$$
For $p = 2$, this is $0$ iff $\xi$ is the mean of $f$. But this is not true for $p \ne 2$.
