๐Ÿงฎ Brain Teaser

The Continuous Function That Cannot Be Monotone on Any Interval

Let f:[0,1]โ†’Rf : [0,1] \to \mathbb{R} be a continuous function. Suppose that for every xโˆˆ[0,1]x \in [0,1], there exists yโˆˆ[0,1]y \in [0,1] with y>xy > x such that f(y)>f(x)f(y) > f(x).

Must ff be non-decreasing on some subinterval [a,b]โŠ‚[0,1][a,b] \subset [0,1] with a<ba < b?

continuitymonotonicitynowhere monotonecounterexampleoscillation

Answer: The Continuous Function That Cannot Be Monotone on Any Interval

Key Idea / Intuition

The condition says every point has a "witness" to its right that is higher โ€” one might expect this forces some local monotone increase. But the answer is No: the condition only guarantees ff is not eventually decreasing everywhere, yet a continuous function can still be nowhere monotone (neither increasing nor decreasing on any interval). The Weierstrass nowhere-differentiable function, for instance, is nowhere monotone โ€” and one can craft a simple self-referential example to see why the condition fails to force monotonicity.

In fact, a cleaner way to see this: the condition in the problem is equivalent to saying ff does not attain its maximum at x=0x=0 while being non-increasing, but it says nothing like "locally increasing." We exhibit a concrete counterexample.


Formal Proof / Solution

Claim: No. The condition does not force ff to be non-decreasing on any subinterval.

Step 1: Construct a Counterexample

Define f:[0,1]โ†’Rf:[0,1]\to\mathbb{R} by f(x)=x+ฮตโ‹…g(x),f(x) = x + \varepsilon \cdot g(x), where g(x)g(x) is the Weierstrass nowhere-differentiable function (continuous, nowhere monotone on any interval), and ฮต>0\varepsilon > 0 is chosen very small. But let us use an even more elementary construction.

Elementary counterexample. Let f(x)=xsinโกโ€‰โฃ(1x)(xโˆˆ(0,1]),f(0)=0.f(x) = x\sin\!\Bigl(\frac{1}{x}\Bigr) \quad (x \in (0,1]),\qquad f(0) = 0.

This ff is continuous on [0,1][0,1]. On any subinterval [a,b][a,b] with 0<a<b0 < a < b, the function oscillates (the zeros xn=1/(nฯ€)x_n = 1/(n\pi) accumulate at 0), so ff is neither non-decreasing nor non-increasing on [a,b][a,b] near zero.

Check the condition: For any xโˆˆ[0,1)x \in [0,1), we need some y>xy > x with f(y)>f(x)f(y) > f(x).

  • For x=0x = 0: f(0)=0f(0) = 0. Take y=1/(2ฯ€+ฯ€/2)=2/(5ฯ€)y = 1/(2\pi + \pi/2) = 2/(5\pi), where sinโก(1/y)=1\sin(1/y) = 1, so f(y)=y>0=f(0)f(y) = y > 0 = f(0). โœ“
  • For any x>0x > 0: the function xโ†ฆxx \mapsto x grows, and the oscillation xsinโก(1/x)x\sin(1/x) reaches values near xx on each "bump." More precisely, in any interval (x,x+ฮด)(x, x+\delta) there are points where sinโก(1/t)=1\sin(1/t) = 1, giving f(t)=t>xโ‰ฅf(x)f(t) = t > x \geq f(x) when f(x)โ‰คxf(x) \leq x. Even when f(x)=xf(x) = x (i.e., sinโก(1/x)=1\sin(1/x)=1), take yy slightly larger where sinโก(1/y)\sin(1/y) is again near 1; then f(y)โ‰ˆy>x=f(x)f(y) \approx y > x = f(x). โœ“

So the condition holds everywhere, yet ff is nowhere monotone near 00.

Step 2: Why the Condition Is Weaker Than It Looks

The condition "โˆ€x\forall x, โˆƒy>x\exists y > x with f(y)>f(x)f(y) > f(x)" says precisely:

ff does not achieve a global right-maximum at any point, i.e., for every xx, ff is not maximized over [x,1][x,1] at xx.

This is a global condition (there exists some yy far away), not a local one. It does not say ff is increasing in a neighborhood of xx.

Step 3: The Contrast with a True Theorem

A correct theorem in this spirit is: if fโ€ฒ(x)>0f'(x) > 0 at every point, then ff is strictly increasing (by the MVT). The condition in the problem is far weaker โ€” it only provides one witness point per xx, which may be far away and cannot be used to construct a monotone piece.

Conclusion

The answer is No. A continuous function satisfying the condition need not be non-decreasing on any subinterval. The example f(x)=xsinโก(1/x)f(x) = x\sin(1/x) (with f(0)=0f(0)=0) demonstrates this: it satisfies the "witness" condition at every point yet is nowhere monotone near 0.