4

Suppose $f: I \to \mathbb{R}$ where $I = (a,b)$ or $I = \mathbb{R}$, etc. Suppose that every $x$ is either a local maximum of $f$ or a local minimum of $f$. Does it follow that $f$ is a constant function?

I think it's probably easy if you know $f$ is continuous, but assume for the moment that it isn't.

  • 1
    http://page.mi.fu-berlin.de/bhrnds/publ_papers/BGN.pdf – Chris Mar 12 '13 at 15:54
  • Since that was so easy ... how about every point is a strict local maximum or local minimum. – GEdgar Mar 12 '13 at 17:29
  • I am embarrassed to have asked such a dumb question. All the answers below are correct. Any non-constant step function that is either left or right continuous at each point provides another counterexample. What was I thinking? – Richard Hevener Jan 10 '22 at 23:21

4 Answers4

7

No. For example, let $$f(x)=\begin{cases}1 & x \in \Bbb{Q} \\ 0 & x \not \in \Bbb{Q}\end{cases}$$

Chris Eagle
  • 33,306
4

If $f$ is not constant, simply define $f(x)=\chi_{\Bbb Q}$. Or more simply, define $f(x)$ to be any two-valued function on any subsets of $\Bbb R$.

In the above cases, not only is every point a local max/min, each point is, in fact, a global max/min. See copper.hat's answer for other instances where every point is either a local max/min, but not necessarily global.

Clayton
  • 24,751
2

Let $A \subset \mathbb{R}$, and $\alpha \in \mathbb{R}$. Then $\alpha 1_A$ is such a function.

Here is another $f(x) = \lceil x \rceil$.

It is tempting to hypothesize that an equivalent condition is that every $x$ has a neighborhood $U$ such that $|f(U)| \le 2$, but while sufficient, it is not necessary as the following example shows. Let $g = \sum_{n=1}^\infty n 1_{(\frac{1}{n+1}, \frac{1}{n}]}$, and let $U$ be any neighborhood of $0$. Then $|f(U)| = \infty$.

copper.hat
  • 172,524
1

Here is a nested interval proof, assuming continuity of $f$ everywhere:

Suppose $f(a) < f(b)$. Let $a_0$ be the largest number in $[a,b]$ with $f(a_0) = f(a)$, and let $b_0$ be the smallest number in $[a_0, b]$ with $f(b_0) = f(b)$. Then for $x \in [a_0, b_0]$ we have $f(a_0) < f(x) < f(b_0)$. Now $f$ is uniformly continuous on $[a_0, b_0]$. At stage $i$ for $i \geq 1$, find $\delta$ such that if $|x - y| < \delta$, then $|f(x) - f(y)| < (f(b_{i-1}) - f(a_{i-1}) / 2$. Further require that $\delta \leq 1/i$ and that $(b_{i-1} - a_{i-1}) / \delta$ be an integer $> 2$. Break up $[a_{i-1}, b_{i-1}]$ into $n$ segments of equal length $\delta$. Call the left endpoints of these $c_{ij}$, where $0 \leq j \leq n-1. c_{in} = b_{i-1}$. Suppose $f(c_{ij}) \geq f(c_{i(j+1)})$ for $1 \leq j \leq n-2$. Then $$f(b_{i-1}) - f(a_{i-1}) = \sum_0^{n-1} (f(c_{i(j+1)}) - f(c_{ij})) < (f(b_{i-1}) - f(a_{i-1})) / 2 + \sum_1^{n-2} (f(c_{i(j+1)}) - f(c_{ij})) + (f(b_{i-1}) - f(a_{i-1})) / 2 \leq f(b_{i-1}) - f(a_{i-1}),$$ which is a contradiction. Therefore, $f(c_{ij}) < f(c_{i(j+1)})$ for some $j$ between $1$ and $n-2$. Thus, we can find $d_i$ and $e_i$ with $a_{i-1} < d_i < e_i < b_{i-1}$, $f(d_i) < f(e_i)$, and $e_i - d_i = \delta \leq 1/i$. Let $a_i$ be the largest number in $[d_i, e_i]$ with $f(a_i) = f(d_i)$, and let $b_i$ be the smallest number in $[a_i, e_i$] with $f(b_i) = f(e_i)$. Then for $x \in [a_i, b_i]$ we have $f(a_i) < f(x) < f(b_i)$. Also note that $a_{i-1} < a_i < b_i < b_{i-1}$ and $b_i - a_i \leq 1/i$. By the Nested Interval Theorem, $S := \bigcap^{\infty}_{i=0} [a_i,b_i] \neq \emptyset$. Since the lengths are going to $0, S = \{p\}$, where $p = \sup \{a_i\} = \inf \{b_i\}$. If $N$ is an open set $\ni p$, we can find $n$ such that $p \in (a_n, b_n) \subset N$. Then $f(a_n) < f(p) < f(b_n)$, so $p$ is neither a local minimum nor a local maximum.

S.C.
  • 4,984
  • Feel free to ignore this @RichardHevener - I am only including this to clarify why it is important that you established for all $i$: $a_i \lt a_{i+1}$ and $b_i \gt b_{i+1}$ rather than $a_i \leq a_{i+1}$ and $b_i \geq b_{i+1}$. https://math.stackexchange.com/questions/4350474/question-related-to-when-the-intersection-of-a-nested-interval-is-a-singleton. In particular, we can then say that for all $n$: $a_n \lt p \lt b_n$. – S.C. Jan 06 '22 at 20:54
  • Given the above claim, and letting $N$ (referenced at the end of the answer) equal $(p-\delta,p+\delta)$, for any $\delta \gt 0$, we can reason that there is an $n$ and corresponding $b_n,a_n$ satisfying $b_n-a_n\leq\frac{1}{n} \lt \delta$. Now, because $a_n \lt p \lt b_n$, and noting $b_n-a_n=|a_n-p|+|b_n-p|$, it should be clear that $a_n \in (p-\delta,p)$ and $b_n \in (p,p+\delta)$. – S.C. Jan 06 '22 at 21:17
  • In the final sentence, the claim being made effectively amounts to the, "In any neighborhood around $p$, we can always find an object to the left that is less than $f(p)$ and an object to the right that is greater than $f(p)$." Recalling the definitions of local maximum and local minimum, we see, then, that these definitions can never be satisfied. – S.C. Jan 06 '22 at 21:28