# Can a function have a strict local extremum at each point?

A problem given in Spivak's Calculus text is to show that a function $f:[a,b]\to \mathbb{R}$ cannot have a strict local maximum at each point. I will sketch the proof below the fold.

My question is: can a function $f:[a,b]\to \mathbb{R}$ have a strict local extremum at each point, perhaps a combination of strict local minima and maxima?

If there did exist such a function, the sets $\{x: x\text{ a strict local maximum}\}$ and $\{x: x\text{ a strict local minimum}\}$ must both be dense, since if not, once we get our hands on an interval which contains only one type of extremum, the proof goes forward as before.

Addendum: Such a function, if it were to exist, could not be continuous on any nonempty open set, because I claim a continuous function with a local (non-strict) extremum at each point must be a constant, which is a contradiction, because a constant function has no strict extrema.

Proof that $f:[a,b]$ cannot have a strict local max at each point: Suppose $f$ is such a function. take any point $x_1$ in $[a,b]$ and surround it with an interval $[a_1,b_1]$ such that $0<b_1-a_1< \frac12 (b-a)$ such that $f(x)<f(x_1)$ for all $x\in [a_1,b_1]$. Now take any point in $[a_1,b_1]$ and get an interval $[a_2,b_2]$, again reducing the length by at least half, and so on. These intervals must have a common point $p$, which cannot be a local maximum, since it has points $x_i$ arbitrarily close to it such that $f(x)>p$.

• Thomae's function has a strict local maximum at every rational number and a not-strict local minimum at each irrational number. That doesn't quite meet the criteria for being a counterexample, but it might be a good starting point. Aug 11 '14 at 23:03