Solution (source code)

= Solution

The <strong maximum principle for harmonic functions> states that a $C^2$ <harmonic function> on a connected domain which attains its supremum at an interior point is constant. Applying it to $-u$ gives the corresponding assertion for an attained infimum.

Let $M=u(x_0)=\sup_\Omega u$. The ball <mean value property for harmonic functions> gives, for every sufficiently small ball about $x_0$,
$$
\int_{B_r(x_0)}(M-u)\,dx=0.
$$
The integrand is continuous and nonnegative. If it were positive at any point, it would be bounded below by a positive number on a smaller ball, contradicting the zero integral. Therefore $u=M$ on the whole ball. The set $A=\{x\in\Omega:u(x)=M\}$ is relatively closed by <continuity> and relatively open by this same argument at each of its points. It is nonempty. <Connected space> forces $A=\Omega$, proving the principle. If the open set is disconnected, constancy is asserted on the relevant <connected component>.