The mean value property and local maximum 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.
 A: The following argument works under the assumptions that $u$ is continuous in $\Omega$.
Assume your function $u$ has a local maximum in $x$, i.e. $M:=u(x)\geq u(y)$ for each $y$ in some open neighbourhood $U$ of $x$ contained in $\Omega$.
Let $R_x\leq a(x)$ be the radius of greatest ball centered in $x$ which is contained in $U$; then from the mean value property on balls you get:
$$\forall 0<r<R_x,\quad M=\frac{1}{\omega_N\ r^N} \int_{B(x;r)} u(y)\ \text{d} y\; .$$
Equality $M=\frac{1}{\omega_N\ r^N} \int_{B(x;r)} u(y)\ \text{d} y$ holds if and only if $u\equiv M$ in $B(x;r)$: in fact, if by contradiction you assume that there exists $\bar{y} \in B(x;r)$ s.t. $u(\bar{y})<M$, then there exists a nonempty open set $V\subseteq B(x;r)$ s.t.:
$$\forall y\in V,\quad u(y)<M\; ;$$
hence:
$$M=\frac{1}{\omega_N r^N}\int_{B(x;r)} u(y)\ \text{d} y = \frac{1}{\omega_N r^N}\left( \int_{V} u(y)\ \text{d} y + \int_{B(x;r)\setminus V} u(y)\ \text{d} y\right) <M$$
which is a contradiction!
Therefore $u(y)=M$ for all $y\in B(x;r)$ and $r<R_x$, that is $u\equiv M$ in $B(x;R_x)$.
Previous argument proves that the set $\Omega_M:=\{y\in \Omega :\ u(y)=M\}$ is both nonempty (because it contains $B(x;R)$) and open (for, if $y\in \Omega_M$ then one can repeat the previous argument to show that there exists an open ball $B(y;R_y)$ which is contained in $\Omega_M$); on the other hand $\Omega_M$ is relatively closed in $\Omega$, because $u$ is continuous.
Thus you found a subset $\Omega_M$ which is nonempty, open and relatively closed in $\Omega$; but $\Omega$ is connected hence its only nonempty, open and relatively closed subset is $\Omega$ itself, therefore $\Omega_M =\Omega$ and $u\equiv M$ everywhere.

On the other hand, previous proof works also if your function $u$ has the mean value property on spheres, that is if:
$$u(x)=\frac{1}{N\omega_N r^{N-1}}\int_{\partial B(x;r)} u(y)\ \text{d} \sigma (y)$$
for all $0<r<a(x)$.
In fact, equality $M=\frac{1}{N\omega_N\ r^{N-1}} \int_{\partial B(x;r)} u(y)\ \text{d} \sigma (y)$ holds if and only if $u\equiv M$ in $\partial B(x;r)$, hence $u\equiv M$ in $B(x;R_x)=\{x\}\cup \left(\bigcup_{0<r<R_x} \partial B(x;r)\right)$ and you can conclude the argument as before.
