TITLE: Compact preimage of a point by C¹ function
QUESTION [6 upvotes]: Let $f:\mathbb{R}^{m} \to \mathbb{R}$ ($m \geq 2$) be a $C^{1}$ function such that, for some $c \in \mathbb{R}$, $f^{-1}(c)$ is compact and non-empty. Show that $F=\{x \in \mathbb{R}^{m} | f(x) \leq c\}$ or $G=\{x \in \mathbb{R}^{m}| f(x) \geq c\}$ is compact.
$F$ and $G$ are closed, then I only need show that one of them is bounded. I have tried to show by contradiction.

REPLY [7 votes]: HINT 
Consider a closed ball containing the preimage of the point. Assume that neither of the other two sets is contained in this ball. Take a point outside where the value is > c , another where the value is < c, and join them by a path not intersecting the ball.