Consider a continuous function $f:\mathbb R^n\to\mathbb R$. The set $$M=\{x\in\mathbb R^n ; f(x)\leq c\}$$ where $c$ is a real number. It follows from continuity that $M$ is closed.
I have seen a proof of the above statement using the fact that we can define the set of $M$ as the preimage $f^{-1}((-\infty,c])$ and since $(-\infty,c]$ is closed we use continuity to conclude that $M$ is closed.
I am not sure why this argument works. Which definition of continuity do we use here?
Also, is there a different way to prove this statement? Maybe by using sequences?
I'd appreciate any help/hint. Thank you.
Suppose $x_k$ is a sequence in $M$ and $x_k\to x_0.$ By continuity, $f(x_k) \to f(x_0).$ The limit of a sequence whose terms are all $\le c$ must itself be $\le c.$ Thus $f(x_0)\le c,$ which implies $x_0\in M.$ It follows tha $M$ is closed.