Proof of maximum principle theorem using mean value theorem Let $f:\mathbb{R}^2 \rightarrow \mathbb{R}$ be a function twice differentiable such that $\Delta f = 0$ on an open disc $D$ of center $0$ and radius $\rho > 0$.
We are given the mean value formula:
$$f(0)=\frac{1}{\pi \rho^2}\iint_{D(0, \rho)}f(x,y)dxdy$$
Let $U$ be a connected and bounded set of $\mathbb{R}^2$ and suppose that $\Delta f=0$ on U. Prove that if $f_{\lvert \overline{U}}$ reaches its maximum on $U$ then $f$ is constant on $U$.
I think I have the structure of the proof but fail to formalize it.
My attempt to prove it:
Let $m$ be the maximum of the function.
Since $U$ is connected, $\forall x \in U$ there exists a path $\phi:[0,1]\rightarrow U$ such that $\phi(0)=x$ and $\phi(1)=m$.
Let's take a finite number of points in $U$, $x_1, x_2, ..., x_n$ along the path and let $\epsilon_1, ..., \epsilon_n$ be the radiuses of the open discs $D(x_i, \epsilon_i)$ such that the discs overlap.
Using the mean value formula for $m$, it follows that:
$$f(m)=\frac{1}{\pi \rho^2}\iint_{D(m, \epsilon_{max})}f(x,y)dxdy$$
where $\epsilon_{max}$ is the radius of the disc $D(m, \epsilon_{max})$ such that it overlaps the disc $D(x_n, \epsilon_n)$.
Hence it follows that $f(m)=f(x_n)=...=f(x_1)$.
Hence by generalizing this reasoning to every $x$ in $U$, it follows that $f$ is constant on $U$.
 A: What you've missed is using the fact that $m$ is an interior maximum.
The intuition for the argument begins by considering a local form of the mean value property, meaning $f(x_0)=\frac{1}{\pi r^2} \iint_{B_r(x_0)} f(x) dx$ for some particular $x_0$ and some particular $r>0$. Say you have this property  and $f(x_0)>f(x)$ for some $x$ in that disk, then you must also have $f(x_0)<f(y)$ for some $y$ in that disk to compensate for the contribution to integration from a vicinity of $x$ being too small.
More formally, we know there exists a disk $B_r(m)$ on which $f(m) \geq f(x)$. We want to show $f(m)=f(x)$ for all $x \in B_r(m)$. So suppose by way of contradiction that $f(m)>f(x_0)$ for some $x_0 \in B_r(m)$. Then by continuity there exists a whole neighborhood of $x_0$ such that for all $x$ on that neighborhood, $f(m)>f(x)$. Since $f(m) \geq f(x)$ on all of $B_r(m)$, you conclude that $f(m)> \frac{1}{\pi r^2} \iint_{B_r(m)} f(x) dx$ which contradicts the mean value property. So you conclude that no such $x_0$ exists i.e. $f(m)=f(x)$ for all $x \in B_r(m)$.
You can now propagate this around the domain "manually" by using the idea that you said: pick a point in $B_r(m)$, draw a new disk around that point, and repeat, until you arrive at any given point $x_0$. Alternatively you can use topology, since what we just said implies that $\{ x : f(x)=M \}$ is open and it is automatically closed by continuity, and a nonempty clopen subset of a connected space is the whole space.
