# Is such function always monotone?

If a continuous real function $f$ on an interval is such that for each $a$ on its domain there is $\epsilon>0$ such that $[a;a+\epsilon[$ is monotone increasing, does it follow that $f$ is monotone increasing on the interval?

By "monotone increasing" I mean the implication $x\leq y\implies f(x)\leq f(y)$.

• I've edited the question for clarity – porton Jul 27 '16 at 15:09

For convenience, let $f$ be defined on $[a,b]$. For some $x' \leq b$, $f$ is monotone on $[a,x']$. Let $x$ be the supremum of these, so that for at least every $a < x' < x$, we have $f$ monotone on $[a,x']$. By continuity then, $f$ is monotone on all of $[a,x]$; for if $f(x) < f(x')$ for some $a < x'< x$, then there is an $x''$ near $x$ with $f(x'') < f(x')$.

Now if $x \neq b$, we can find $\epsilon$ so that $f$ is monotone on $[x,x+\epsilon)$ contradicting that $x$ was the supremum. Thus $x = b$ and $f$ is monotone.

• I had in mind "nonstrict" monotonicity rather than strict monotonicity as in your proof. Can the proof be modified for nonstrict monotonicity? – porton Jul 27 '16 at 16:00
• The proof is for non-strict monotonicity. It can be adapted for strict monotonicity by replacing $f(x) < f(x')$ by $f(x) \leq f(x')$ and similarly for $f(x'') < f(x')$. (Perhaps it becomes clearer if you read $f(x) < f(x')$ as $f(x) \not \geq f(x')$ instead, and similarly for $f(x'') < f(x')$.) – Mees de Vries Jul 27 '16 at 16:09
• It seems that your proof does not work for nonstrictly increasing $f$: You advised (in a now deleted comment) that we can take $\varepsilon = f (x') - f (x) > 0$; by continuity there exists a point $x''$ sufficiently close to $x$ such that $| f (x) - f (z) | < \varepsilon$. But we can't take $\varepsilon=0$. – porton Jul 29 '16 at 19:15
• Gotcha: I take all $\varepsilon > f (x') - f (x) \geq 0$ and then it is easy to reconstruct the proof – porton Jul 30 '16 at 13:39
• Actually, the proof works (as written) for non-strict monotonicity, although you are right it needs slightly more modification for the strict case than I previously stated. – Mees de Vries Aug 2 '16 at 22:22

The answer is no. Consider something like the absolute-value function on the interval $[-1,1]$. For each $x < 0$ the function is monotone-decreasing on $[x,x/2)$ and for each $x>0$ the function is monotone-increasing on $[x,1)$.

I'm not sure about the following sharpening of the question:

If a continuous real function $f$ on an interval is such that for each a on its domain there is ϵ>0 such that [a;a+ϵ[ is monotone increasing (decreasing), does it follow that f is monotone increasing (decreasing) on the interval?

• I've edited the question. Saying "monotone" I meant "monotone increasing": $x\leq y \implies f(x)\leq f(y)$ – porton Jul 27 '16 at 15:10

Without loss of generality let us assume you want to show the function is increasing.

Take two points $x,y$ with $x<y$ on your (unspecified) interval. We have o show $f(x)< f(y).$ These two points lie in the interval $[a, a+\epsilon[$ for some $\epsilon >0$. There your hypothesis gives it is increasing. QED.

EDIT: As I understood the hypothesis wrongly my answer above is useless. Let it be there.

• The hypothesis says "there exists some $\varepsilon$ such that. . . . " and not "for every $\varepsilon$ we have that. . . ." – Daron Jul 27 '16 at 15:04
• I formulated my question wrongly. We should assume that $[a;a+\epsilon[$ is increasing for some $\epsilon>0$ rather than for every $\epsilon>0$ – porton Jul 27 '16 at 15:04
• I am editing my answer. – P Vanchinathan Jul 27 '16 at 15:06