Locally monotone function is monotone

A function $f:\mathbb{R}\rightarrow\mathbb{R}$ is locally monotone at point $a$ iff there exists $\epsilon>0$ such that $f|_{]a-\epsilon;a+\epsilon[}$ is monotone ($x\ge y\Rightarrow f(x)\ge f(y)$ for all points $x$, $y$ of $]a-\epsilon;a+\epsilon[$).

Question If a function is locally monotone at all points of real line (or more generally an interval on real line), then it is monotone on the entire real line (or more generally, on this interval)?

If it does not hold for any intervals, does it hold for closed intervals?

• Yes, locally monotone implies monotone, basically because $\mathbb{R}$ is connected. Your job is to prove this, I presume :) – BrianO Oct 10 '15 at 19:36

1 Answer

Let $I$ be an order-convex subset of $\Bbb R$, and suppose that $f:I\to\Bbb R$ is locally monotone. For $a,b\in I$ write $a\sim b$ iff either $a\le b$ and $f$ is monotone on $[a,b]$, or $b<a$ and $f$ is monotone on $[b,a]$; $\sim$ is an equivalence relation on $I$. $I$ is connected, and it follows from the local monotonicity of $f$ that each $\sim$-equivalence class is open, so $I$ must be a $\sim$-class, and $f$ is monotone on $I$.

• It doesn't get much better -- anyway, it doesn't get more succinct! No pesky epsilons. Very nice. – BrianO Oct 10 '15 at 19:40
• I don't get why $I$ must be a $\sim$-class – porton Oct 10 '15 at 19:40
• @porton: If not, let $[a]$ be some $\sim$-class. Then $[a]$ and $I\setminus[a]$ are a partition of $I$ into open sets, contradicting the connectedness of $I$. – Brian M. Scott Oct 10 '15 at 19:42
• @porton If there were multiple $\sim$-eq classes, they would form an open partition of $I$; but $I$ is connected. – BrianO Oct 10 '15 at 19:42