Let $\varphi\in \mathcal C^2(\Omega )\cap \mathcal C(\bar\Omega )$ a harmonic function where $\Omega \subset \mathbb R^n$ is a domain. I want to prove that $$\max_\overline\Omega \varphi=\max_{\partial \Omega }\varphi.$$
The Mean value property says that $$\varphi(x)=\frac{1}{|B_r|}\int_{B(x,r)}\varphi(y)d y$$ and $$\varphi(x)=\frac{1}{|\partial B(x,r)|}\int_{\partial B(x,r)}\varphi(y)dy,$$
where $B(x,r)\Subset \Omega $ (i.e. s.t. $\overline{B(x,r)}\subset \Omega $).
Question 1) What is the difference between those two integral ? I see that the first one is over $B(x,r)$ and the second one on $\partial B(x,r)$. Does it mean that in the first integral, $x\in B(x,r)$ and on the second one, $x\in \partial B(x,r)$ ?
Question 2) Let $x\in \Omega $ s.t. $\varphi(x)=\max_{\Omega }\varphi$ and $r>0$ s.t. $B(x,r)\Subset \Omega $. We do we have immediately from Mean value property that $\varphi$ is constant on $B(x,r)$ ? To me, mean value property just tel us that $$\varphi(x)=\int_{B(x,r)}\varphi(y)dy=\max_{\Omega }\varphi.$$ I don't see where the fact that $\varphi$ is constant comes from.
Question 3) Let $$\mathcal A=\{x\in \Omega \mid \varphi(x)=\max_{\Omega }\varphi\}.$$
The fact that $\mathcal A$ is closed is obvious (since $\mathcal A=\varphi^{-1}(\{\max_\Omega \varphi\}$) and $\varphi$ continuous). But why is it "obviously" open ? (it's what it's written in my course).
Question 1: The first integral is the average over the solid ball $B(x,r)$, the second one is the integral over its boundary. clearly $x \in B(x,r)$ but $x \notin \partial B(x,r)$, because $x$ is the center of this ball and cannot be on its boundary.
Question 2: Suppose $\varphi$ and $B(x,r)$ are as in your assumptions. If $\varphi$ is not constant on $B(x,r)$, then $\varphi(y) \le \varphi(x)$ for all $y \in B(x,r)$, with strict inequality on some open subset, since by assumption $\varphi$ attains its maximum at $x$. But then the mean value property cannot hold, since it would follow that $|B(x,r)|^{-1} \int_{B(x,r)} \varphi(y) dz < \varphi(x)$.
Question 3: It now follows that $\mathcal{A}$ is either empty (if $\varphi$ is non-constant) or all of $\Omega$ (if $\varphi$ is constant. Both sets are open.