Real Analysis – Continuous Functions with Local Extrema at Every Point

analysisreal-analysis

Let $f:[0,1]\to\mathbb R$ is a continuous function, and for all $x\in [0,1]$, $f(x)$ is either a local maximum or a local minimum. Then prove that $f$ is a constant.

Here is what I have tried, I don't know whether it is correct:

Assume $f$ is not a constant, by continuity, there exist $x_1$, $x_2$ such that $f(x_1)=m$ is a global minimum and $f(x_2)=M$ is a global maximum. Now if $m\ne M$, choose any $c\in(m,M)$ and define

$$x_0=\sup (x\in[x_1,x_2]:f(x)<c)$$

Then we have $f(x_0)$ NOT a local minimum nor a local maximum (since according to the definition of $x_0$, there are always some points $<c$ in the left neighborhood of $x_0$ and the points in right neighborhood are always $>c$). Contradiction arises and so $f$ must be a constant.

Best Answer

It is a funny countable vs uncountable argument, I least expected that. My hint (in the comments) to use a nested sequence of intervals only made me confused. (But it made me think that if $C$ is the union of all open intervals on which $f$ is locally constant then $f(C)$ is countable. I tinkered a bit with ideas like considering cases, whether $[0,1]\setminus C$ contains an open interval (then the proof by the OP works), or whether $C$ is dense, looked at $f([0,1])\setminus f(C)$ and at some point figured it was easier than that and I may formally forget about $C$, and ignore some irrelevant details.)

So say $f$ were not constant, hence $f([0,1])=[m,M]$ with $m<M$. For each $y\in[m,M]$ pick $x_y\in[0,1]$ with $f(x_y)=y$. Let $X=\{x_y:y\in[m,M]\}$. In other words we picked a set $X\subset[0,1]$ such that the restriction of $f$ to $X$ is one-to-one and onto $[m,M]$.

Let $T=\{x\in X: f $ has a local maximum at $x\}$ and $S=\{x\in X: f $ has a local minimum at $x\}$. Since $X=T\cup S$ and (cardinality) $|X|=|[m,M]|=\mathfrak c = 2^{\aleph_0}$, at least one of $T$ and $S$ is uncountable. Say $T$ is uncountable.

For each $x\in T$ pick $n_x\in\mathbb N$ such that $f(x)\ge f(z)$ whenever $z\in(x-\dfrac1n,x+\dfrac1n)\cap[0,1]$. Let $T_n=\{x\in X: n_x=n\}$. Clearly $T=\bigcup\limits_{n\in\mathbb N} T_n$, hence there is an $n$ for which $T_n$ is uncountable.

Then $T_n$ must have a limit point, i.e. a $t\in[0,1]$ such that every neighborhood of $t$ contains infinitely many elements of $T_n$. Hence we may pick two different points $p,q\in T_n$ each very close to $t$ and hence (absolute value) $|p-q|<\dfrac1n$. But this means $f(p)\le f(q)$ and $f(q)\le f(p)$, thus $f(p)=f(q)$, contradicting that the restriction of $f$ to $X$ were one-to-one.

Related Question