I'm reading this proof of the maximum principle: Understanding this proof about the principle of the maximum
it looks ok for me, but why does $u\in C^2(\Omega)\cap C(\overline\Omega)$? I don't recognize this information being used in the proof. I know that we need second derivatives to exist so we can use the argument that the second derivatives are $\le 0$ (or the laplacian is $\le 0$) in a possible maximum point. However, why they need to be $C^2$? And why $C(\overline\Omega)$?
Also, why $\Omega$ needs to be open and bounded? I guess it needs to be bounded because we can take the diameter in the proof. However, I can see it working for closed $\Omega$.
The $C^2(\Omega)$ condition is needed for second derivatives to exist (so that $\Delta u=0$ makes sense). The $C(\overline{\Omega})$ condition ensures that $u$ attains its maximum on $\overline{\Omega}$ so that considering the maximum on $d\Omega$ makes sense.
The open condition is given so that the interior of $\Omega$ is non-empty for otherwise the assertion is trivial.