TITLE: Show that a function that is locally increasing is increasing?
QUESTION [6 upvotes]: A function $f : \mathbb{R} \to \mathbb{R}$ is locally increasing at a point $x$ if there is a $\delta > 0$ such that $f(s) < f(x) < f(t)$ whenever $x-\delta < s < x < t < x+\delta$. 

Show that a function that is locally increasing at every point in $\mathbb{R}$ must be increasing, i.e., $f(x) < f(y)$ for all $x < y$.

REPLY [10 votes]: HINT: Suppose that $f$ is locally increasing at every point of $\Bbb R$, but $f$ is not an increasing function; then there are $a,b\in\Bbb R$ such that $a<b$ and $f(a)\ge f(b)$. Let
$$B=\{x\in[a,b]:f(a)\ge f(x)\}\,;$$
$B\setminus\{a\}$ is non-empty, since $b\in B$, and is bounded below by $a$, so $B\setminus\{a\}$ has a greatest lower bound $x_0\in[a,b]$.
Show that $x_0\in B$, and consider two cases:

$x_0=a$. Use the hypothesis that $f$ is locally increasing at $a$ to get a contradiction.
$x_0>a$. Then $f(x)>f(x_0)$ for each $x\in(a,x_0)$. Use the fact that $f$ is locally increasing at (what point?) to get a contradiction.

Alternatively, if you’re familiar with the open cover definition of compactness, you can let $[a,b]$ be any closed interval and use the hypothesis that $f$ is locally increasing at every point to get a cover $\mathscr{U}$ of $[a,b]$ by open intervals on each which $f$ is increasing, then use compactness of $[a,b]$ to get a finite subcover and show directly from the existence of this finite subcover that $f$ must be increasing on $[a,b]$. Since $a\le b$ are arbitrary, this shows that $f$ is increasing.