I have an exercise in P.D.E that I couldn't solve.
Let $\Omega \subset \mathbb{R}^n$ be a connected open set and $u:\Omega \to \mathbb{R}$ a continuous function that satisfies the following property:
(1) $\forall x \in \Omega \ \exists a(x) > 0$; $\forall 0 < r < a(x): u(x) =\displaystyle\frac{1}{\omega_n r^{n-1}} \int_{S_r(x)} u(y)d\sigma(y)$
Show that, if $u$ has a local maximum or a local minimum, then $u$ is constant in $\Omega$.
I know how to solve that exercise if $u$ has a global maximum, but I don't know how to change the solution for the case of a local maximum.
Of course I know that functions that satisfies the property (1) are harmonic (real-analytic!) but I can't use that because this exercise is just a step to show that functions that satisfies (1) are harmonic!
PS: I'm sorry for my really bad English. I'm from Brazil and almost never have to write in other language than Portuguese. :)
PS2: It would be good if I show how to solve this exercise for the case of global maximum so you guys can help me to adapt the solution?
EDIT: As @D.Thomine noticed, it is necessary to supose that f is continuous.