Let $f: [0, 1] \to \mathbb R$ be a function on the unit interval. We say $y \in \mathbb R$ is a local maximum value of $f$ if $y = f(x)$ for some strict local maximum $x$ of $f$.



> 
> **Question:** Does there exist a $C^1$ function $f$ on the unit interval such that the set of local maximum values of $f$ is dense in some (nontrivial) open interval $(a, b)$?
> 
> 
> 


Remark: Note that a $C^0$ example is provided by a Brownian motion sample path, since a Brownian motion almost surely achieves a strict maximum in every interval.



$C^1$ function with a dense set of maximum values
Such a function cannot exist. Let $M \subset [0,1]$ be the set of strict local maxima of $f$, and $C \subset [0,1]$ be the critical points, that is the set of points $x \in [0,1]$ so that $f'(x) = 0$. Then $f(C)$ is a closed subset of $\mathbf{R}$. As a consequence, if $f(M) \cap (a,b)$ were dense in some interval $(a,b)$ then necessarily $(a,b) \subset f(C)$. This is impossible because $f(C)$ has zero measure by Sard's theorem.


**Edit.** To see why $f(C)$ is closed, we can argue as follows. Let $(y\_k \mid k \in \mathbf{N})$ be any convergent sequence in $f(C)$, with $y\_k \to y$ as $k \to \infty$. We may pick a sequence $(x\_k \mid k \in \mathbf{N})$ of points in $C$ so that $f(x\_k) = y\_k$. After extracting a subsequence we may additionally assume that $x\_{k'} \to x \in [0,1]$ say, which is a critical point. Therefore $f(x\_{k'}) = y\_{k'} \to f(x) = y$, which in conclusion belongs to $f(C)$.


