# Is there always a way up?

I am trying to find a simple criterion for a real continuous function $$f$$ on a connected, open subset $$U$$ of $$\mathbb R^n$$ that would imply the following property (P)

For any $$x, y \in U$$ such that $$f(x), there exists a continuously differentiable path $$\gamma:[0,1] \rightarrow U$$ such that $$\gamma(0)=x, \gamma(1)=y$$ and $$f(\gamma(t))$$ is increasing.

Intuitively, this "there is always a way up" property will hold for $$f$$ such that $$f^{-1}((c, \infty))$$ is connected for any $$c \in \mathbb R$$. However, if the set $$f^{-1}(c)$$ is highly irregular then my intuition might break down.

So the question is, does this criteria guarantee the property (P)? If not, is there a simple criterion for $$f$$ such that (P) is satisfied?

Added: Since the question is for satisfying my curiosity rather than solving a specific problem, feel free to modify any hypothesis of the question (changing 'connected' to 'path connected' or changing the regularity of $$f$$ for example). Any result, positive or negative, is welcomed.

Added: The criterion I proposed has a trivial counterexample: consider $$f$$ on $$\mathbb R$$ having a unique maximum. Anyway, the main question is to find a criterion for (P). I guess it should be that the inverse image of any interval is path connected.

• I think there are mistakes in the statement Commented Apr 6, 2023 at 6:44
• This does not seem to be a fair game: $f$ is only continuous but the path $\gamma$ should be $C^1$. Commented Apr 6, 2023 at 7:31
• Also, wouldn't it be more natural to assume $f^{-1}(c,\infty)$ path connected, if we want to make such an assumption? Commented Apr 6, 2023 at 21:01
• @ChristianRemling Right. Because there is already an answer, I can't modify the hypothesis of the question. Commented Apr 7, 2023 at 3:39
• I think that as the second counterexample by K.Fabian shows you, you will at the very least need global concavity (otherwise you just introduce a dimple somewhere). Commented Apr 12, 2023 at 0:35

I think the answer is no: $$f^{-1}((c,\infty))$$ being connected is not sufficient. My idea for a counterexample is to begin with a set that is connected but not path connected (the topologist's sine curve), and try to make some of the regions of the form $$f^{-1}((c,\infty))$$ resemble that set, so that they are also connected but not path connected.
Let $$n=2$$ and $$U = (-1,1) \times (0,1)$$. Let $$G$$ be the graph of the function $$y = e^{-x}\sin(1/x)$$ with $$x \in (0,1/2)$$. (Roughly, this is a copy of the topologist's sine curve limiting onto the line segment $$\{0\} \times [0,1]$$, but tapering in such a way that the sine-like part of $$G$$ is contained entirely in $$U$$.) Now define your function $$f$$ by taking $$f(x,y) = 0$$ if $$(x,y) \in G$$, $$f(x,y) = -x$$ if $$x \leq 0$$, and $$f(x,y) = -\mathrm{dist}((x,y),G)$$ if $$x > 0$$ and $$(x,y) \notin G$$. Roughly, this function is constantly $$0$$ on $$G$$, and steadily increasing to the left of the $$Y$$-axis, but it is negative everywhere to the right of the $$Y$$-axis except on $$G$$.
Now the point is you cannot "go upwards" from a point in $$G$$ to a point that is left of the $$Y$$-axis. The reason is that $$\overline{G}$$ ($$G$$ plus the line segment it limits to) is not path-connected. Any path beginning in $$G$$ must either leave $$G$$ while still to the right of the $$Y$$-axis (but then $$f$$ decreases), or it must stay in $$G$$ forever. Nonetheless, I'm pretty sure that $$f^{-1}((c,\infty))$$ is connected for all $$c$$.
• An interesting additional observation in this example is that $f^{-1}((c,\infty))$ is actually path-connected for all $c$ (for $c\geq 0$ the set does not contain $G$, and for $c<0$ the set contains an open neighborhood of $G$). So this example also shows that path-connectedness of the sets $f^{-1}((c,\infty))$ is not sufficient - though maybe path-connectedness of $f^{-1}([c,\infty))$ is enough to conclude (P)? Commented Apr 7, 2023 at 15:42
• Another observation is that by multiplying $f$ by $e^{-1/x^2}$, we can take $f$ to be $C^\infty$ but the reasoning still holds. So imposing very strong regularity conditions on $f$ is also not going to eliminate this counterexample. Commented Apr 7, 2023 at 15:57
• Sorry for all the comments but let me add one more variant to the counterexample. An obvious way to break condition (P) is to just to force the path to go through a region on which $f$ is constant; a natural prevention is to impose the assumption that for all points $p$, there exists a path from $p$ to some other point on which $f$ is strictly increasing ("no maximal contours"). This extra constraint rules out the counterexample above, but it's possible to fix this by adjusting the values of $f$ to decrease very slowly along $G$, so that $f$ is still valley-shaped between any two waves of $G$. Commented Apr 7, 2023 at 16:24
Another counter-example in $$\mathbb{R}^2$$ is the Mount-St.Helens function $$e^{-(x^2+y^2)} - \frac12\, e^{-9\,\left( \left(x-\frac15\right)^2 +y^2\right)},$$ on $$U=(0,1)^2$$, because one cannot go upwards e.g. from close to $$(1,1)$$ to $$(\frac15,0)$$. In view on these counter-examples one may try the criterion that for all $$c\in \mathbb{R}$$ both sets $$f_{c}~=~ f^{-1}\left( (c,\infty)\right)$$ must be connected. This would at least also fix the previous counterexamples by Will Brian and for e.g $$e^{-x^2}$$ in $$\mathbb{R}$$ by the OP.