Suppose $f:\mathbb{R}^n\to\mathbb{R}$ is a $C^1$ function, I wonder whether or not $f$ is surjective provided that $|\nabla f(x)|=1$ for any $x\in\mathbb{R}^n$ ?
When $n=1,$ the condition $|f^\prime|=1$ implies that $f$ is a non-degenerate linear function, so clearly $f(\mathbb{R})=\mathbb{R}.$ In general dimension, I wish to show that $f(\mathbb{R}^n)$ is both open and closed in $\mathbb{R}.$ Using rank theorem, we obtain that $f(\mathbb{R}^n)$ is an open set in $\mathbb{R}$, but now I have no idea to show that $f(\mathbb{R}^n)$ is closed. Can someone help me?