# Are continuous functions monotonic for very small ranges?

So I am wondering, if we have a continuous function $f : A \to B$, does a range $[x, x + h]$ exist for each $x\in A$ , $h = h(x)>0$ so that $f$ is monotonic in that range?

-
not necessarily. $f(x)=x^2$ changes from decreasing to increasing near $x=0$. – Sabyasachi Mar 20 '14 at 10:46
$f(x)=x \sin \frac{1}{x}$ (with $f(0)=0)$ is continuous at $x=0$, but not monitonic in $[0,h]$ for any $h>0$. – TonyK Mar 20 '14 at 10:48
@Sabyasachi: But your $f$ is monotonic in $[0,h]$ for all $h>0$. – TonyK Mar 20 '14 at 10:48
Weierstrass function (en.wikipedia.org/wiki/Weierstrass_function) ? – Oleg567 Mar 20 '14 at 10:59
@Sabyasachi: You can't do that! The OP said $h \to 0$, so $c$ is presumably fixed. The question was a sensible one, and your interpretation makes it silly. – TonyK Mar 20 '14 at 11:02

No it is not true for example consider the function $x\sin(\frac{1}{x})$. It is continuous at zero if you take the limit to be the value of the function. But it oscillates very rapidly in every small neighbourhood around zero.

If I am not wrong even everywhere continuous but no where differentiable function has this property.I am referring to the function here

-
Yes, any function monotone on an interval is differentiable on a set of positive measure. – Seth Mar 20 '14 at 14:06
@Seth why is the statement you have stated true? can you please give some justification – happymath Mar 20 '14 at 15:25
See my answer for an explanation. – Seth Mar 20 '14 at 18:57

And for an example that fails at every $c$, take the Weierstrass fuction defined by $$f(x)=\sum \limits_{n=0}^\infty\left(\dfrac 1 {2^n} \cos \left(15^n \pi x \right)\right).$$

The plot of this function exhibits self-similarity (see red circle below) and looks something like this:

-
And a proof or reference it fails the monotonicity condition? – user2345215 Mar 20 '14 at 11:06
Nice example. Similar example would be the sample paths of the Wiener process. – Cm7F7Bb Mar 20 '14 at 11:17
@user2345215: The function can't be monotone on any interval because of the standard result (usually seen in a first course in Lebesgue integration) that a function monotone on an interval $I$ must be (finitely) differentiable at almost every point in $I$ (in the sense of Lebesgue measure), and the fact that "almost everywhere in $I$" implies "dense in $I$" (indeed, much more than this). In other words, a very weak consequence of this is that any function that is monotone in an interval must have at least one point of (finite) differentiability in that interval. – Dave L. Renfro Mar 20 '14 at 13:54
See this google search in general. More specifically, see: [1] The "Monotone Differentiation Theorem" in these notes by Terry Tao; [2] This 1963 paper; [3] page 100 of these notes (looks like Royden's book). [4] These notes. – Dave L. Renfro Mar 20 '14 at 18:21
@Cruncher: [I didn't have enough characters left in my last comment to "ping you".] Also, I wanted to add in my last comment that the result is not all that easy to prove, but it's a standard result in virtually every introductory graduate level real analysis course. I do not know if the much weaker result that, for a continuous monotone function and for any interval, there exists at least one point of differentiability. I think it would be interesting if this much weaker version could be proved without appealing to the stronger measure theory version. – Dave L. Renfro Mar 20 '14 at 18:32

Monotone functions are differentiable almost everywhere. So if a function is monotonic on an interval it is differentiable on a set of positive measure. However there are continuous nowhere differentiable functions so it isn't true that continuous functions are monotonic in a (one sided) neighborhood of every point.

An example of a continuous nowhere differentiable function is the Takagi function.

-

Yet another example: the 1-dimensional Brownian Motion (also called "Wiener Process") is continuous but almost surely, it is not monotonic in any interval.

Proof. let $0\le a\le b$ and denote by $P(a,b)$ the probability that the Brownian motion $B(t)$ is monotonic on the interval $(a,b)$. Then by independence of increments (an important feature of Brownian motion), for each $n$ we have that $$P(a,b) \le 2^{-n} P(a, a+(b-a)2^{-n})$$ hence $P(a,b)=0$.

Since the set of all intervals with rational endpoints is countable, it follows that almost surely $B(t)$ is not monotonic on any such interval. By the density of $\mathbb{Q}$ in $\mathbb{R}$ it follows that any interval contains an interval with rational endpoints, hence with high probability $B(t)$ is not monotonic on any interval.

-
I'm not sure this qualifies as an example (as you are not pointing to any one function), but in a sense it is saying that examples exist (in abundance). Indeed most functions that are merely required to be continuous behave like this; it is not pathological but typical behaviour for continuous functions. It is quite remarkable that analysis has long had such an emphasis on differentiable functions, while the awareness that many real-world phenomena are better modelled by such more general continuous functions. – Marc van Leeuwen Mar 20 '14 at 13:42
Brownian motion is a curve, not (necessarily and in fact almost surely not) the graph of a function. – Ittay Weiss Mar 20 '14 at 21:19
@IttayWeiss: It's a function of time. Or a probability space which is a function of time. – Ben Voigt Mar 20 '14 at 22:37
@BenVoigt yes, indeed. It is not a function $\mathbb R \to \mathbb R$ (or from a subset of the reals). – Ittay Weiss Mar 20 '14 at 22:43
@IttayWeiss: Any given trajectory is $B(t) : \mathbb{R} \rightarrow \mathbb{R}$. The domain is time, which is a real number, and the result is position, also a real number. – Ben Voigt Mar 20 '14 at 22:47

Here's an explicit, elementary construction of a continuous but nowhere monotone function, without any appeal to differentiability:

The construction proceeds in phases, with the invariant that after phase $k$, we have chosen finitely many points of the function's graph, such that

1. The horizontal distance between two neighboring points is at most $2^{-k}$, and

2. The slope of the straight line between neighboring points is $\pm\frac{k}{k+1}$, with the sign alternating.

In phase $0$, select the points $(0,0)$ and $(1,0)$

In phase $k\ge 1$, insert two new points between every two neighboring known points $p$ and $q$. Suppose the slope from $p$ to $q$ is positive (namely $\frac{k-1}{k}$); the negative case is the same with opposite signs. Now draw parallel lines of slope $\frac{k}{k+1}$ through $p$ and $q$, and intersect them with the line of slope $-\frac{k}{k+1}$ through the midpoint $\frac12(p+q)$. The two intersections are our two new points. Since $\frac{k}{k+1}>\frac{k-1}{k}$, the two new points will appear in the right order.

After $\omega$ phases, we have selected values for our function at a dense set of $x$ values in $[0,1]$, and restricted to this set the function is uniformly continuous, due to the slope invariant. Therefore it can be uniquely extended to a continuous function $[0,1]\to\mathbb R$.

The extended function is non-monotonic in every open interval. Namely, after finitely many of the phases, at least three points in the interval will have been chosen. If $a,b,c$ are such three consecutive points, $f(b)$ will either be larger than both of $f(a)$ and $f(c)$ or smaller than both of them; in either case $f$ is not monotone in the interval.

-