Why the set of all maximum points of a continuous function is a closed set? Suppose $f(x)$ is a continuous function on domain $\Omega$ and its maximum value is $m$. Let $M={\{x|f(x)=m\}}$, then how do I prove $M$ is a closed set? Thank you!

Suppose $x \notin M$, then $f(x) \neq m$ and since $f$ is continuous, there is some open $U$ containing $x$ such that $f(y) \neq m$ for all $y \in U$, hence $M^c$ is open.
