Theorem. (Maximum Modulus Principle) $\;$If $f$ is a non-constant holomorphic function in a region $\Omega$, then $f$ cannot attains a maximum in $\Omega$.
Problem. Prove the maximum principle for harmonic functions, that is,
(a) If $u$ is a non-constant real-valued harmonic function in a region $\Omega$, then $u$ cannot attain a maximum in $\Omega$.
(b) Suppose that $\Omega$ is a region with compact closure. If $u$ is harmonic in $\Omega$ and continuous in $\overline{\Omega}$, then $$\sup_{z \in \Omega}|u(z)| \leq \sup_{\partial \Omega}|u(z)|$$
My attempt.
(a) Define $g(z) = u_{x}(z) - iu_{y}(z)$. So, $$\frac{\partial}{\partial x}u_{x} = u_{xx}$$ and $$\frac{\partial}{\partial y}u_{y} = -u_{yy}.$$ Thus, $$\frac{\partial}{\partial x}u_{x} - \frac{\partial}{\partial y}u_{y} = 0 \Longrightarrow \frac{\partial}{\partial x}u_{x} = \frac{\partial}{\partial y}u_{y}.$$ Analogously, $$\frac{\partial}{\partial y}u_{x} = -\frac{\partial}{\partial x}u_{y}.$$ Therefore, $g$ is holomorphic and so, there is $f$ such that $f' = g$ and, up to a constant, $u$ is a real part of $f$, i.e, $u$ is holomorphic. Since $u$ is a non-constant holomorphic function in $\Omega$, $u$ cannot attain a maximum in $\Omega$.
(b) Since $u$ is continuous in $\overline{\Omega}$, attains a maximum in $\overline{\Omega}$. But, by the item (a), the maximum cannot attains in $\Omega$, then $$\sup_{z \in \Omega}|u(z)| \leq \sup_{\partial \Omega}|u(z)|.$$
The problem not seems simple to solve. I suspect I've done something wrong. Can someone help me?