# Sign-preservation of continuous map in a small neighborhood

So I was reading a small book on surfaces called "Mostly Surfaces" which is available for free in the internet:

http://www.math.brown.edu/~res/Papers/surfacebook.pdf

In page 32, the author decides to give a self contained proof that the pre-image $S$ of a regular value of a continuously differentiable map $f: \mathbb{R}^{n}\times\mathbb{R} \to \mathbb{R}$ is a $n$-dimensional manifold. To do so, he assumes without loss of generality that $0$ is the regular value in question, and that we can place any $p \in S = f^{-1} (0)$ in the origin with gradient $\nabla f(p) = (0, \ldots, 0, 1)$. So far, no problem.

The idea, then, is to think of $\mathbb{R}^{n}\times \{0\}$ as the "horizontal" direction and $\nabla f$ as the "vertical direction". So, pretty much in the spirit of the Implicit Function Theorem proof, we place a cube around $p$ to work in.

To choose the diameter $\varepsilon$ of the cube, the idea is the following: call "special" segments whose endpoints are in the bottom and top faces of the cube. Since $(0,\ldots,0,1)$ gives the "vertical" direction, I understand that is to say that these segments will intercept the boundaries of the cube in points $(x_{1},\ldots,x_{n}, \pm \varepsilon/2)$.

Then, we choose $\varepsilon$ such that $f$ increases along any of these special segments from bottom to top. The author argues that, by continuity of the gradient, such $\varepsilon$ always exists.

Graphically, I can indeed believe it, specially if I draw a figure in the case $\mathbb{R}^{2} \to \mathbb{R}$. But I was having a hard time prooving it in a convincent manner. Can someone help me to prove why is such choice always possible?

I was following this direction: we know that in the center $p = (0, \ldots, 0)$ of the cube $f(p) = 0$ and $\nabla f$ points upwards. In therms of lenght, the worst case of a special segment is a diagonal ($\sqrt{n}\varepsilon$). So along any special segment, by Taylor, $f(x) - f(x_{0}) \approx \nabla f(x_{0}) \cdot (x - x_{0})$, where $x_{0}$ is it's starting point. So whe could apply Cauchy Schwarz and bound $\| x - x_{0} \|$ by $\varepsilon \sqrt{n}$. The problem is that it gives an estimative in norm to the variation of $f$ along that segment. But how to relate it to the sign? All I can see clearly is that along the gradient direction, $f<0$ below $p$ and $f>0$ above $p$, since the gradient in $p$ is $(0, \ldots, 0, 1)$ and continuous.