This question already has an answer here:

Assume $f$ is continuous over $[a,b]$ and $f$ has a local maximum value at every point in $(a,b)$. Show that $f$ is constant.

Intuitively it makes sense that the constant function should be the constant function, but maybe one strategy is to prove that it is a necessary and sufficient condition on $f$. In other words, $f$ is continuous over $[a,b]$ and $f$ has a local maximum value at every point in $(a,b)$ if and only if $f$ is constant. Alternatively we can think of it as such: at every point $A_i$ over $[a,b]$, there exists some interval $J_i$ such that $A_i$ is greater than or equal to every value in of $f$ in $J_i$.

I am unsure which route to take to solve this.


marked as duplicate by Henricus V., Leucippus, hardmath, user296602, user99914 Mar 31 '16 at 3:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ It's not a local maximum--that's not possible with a constant function since the sign of the derivative never changes (it's always $0$)--there are no local extrema. $\endgroup$ – Jared Mar 31 '16 at 1:32
  • $\begingroup$ @Jared Every point for a constant function is a local maximum, though. $\endgroup$ – user19405892 Mar 31 '16 at 1:34
  • $\begingroup$ @Jared I think this is the following definition they're using for $f$ having local maxima at $x=x^*$: $$(\exists \epsilon > 0)(\forall x \in \Bbb{R})(\lvert x-x^* \rvert < \epsilon \implies f(x^*) \geq f(x))$$ It's the same definiton as used in this Math StackExchange question. $\endgroup$ – Noble Mushtak Mar 31 '16 at 1:34
  • $\begingroup$ @NobleMushtak I'm not sure...but it would seem to me that this would label inflection points where $f'(x) =0$ as local extrema...is that wrong (I mean I'm fairly certain that inflection points are not local extrema)? $\endgroup$ – Jared Mar 31 '16 at 1:38
  • 1
    $\begingroup$ @NobleMushtak Consider the function $f(x) = x^3$ over the domain $x \in [-3, 3]$. The absolute maximum is at $x = 3$ and has a value of $27$ and the absolute minimum occurs at $x = -3$ and has a value of $-27$. Neither of these are local extrema since the function $f(x) = x^3$ has no local extrema. If you're saying that we should only consider $x$ inside the given domain (which your definition does not) then yes, those two points satisfy your definition of local extrema--but I've never seen any text book or Calculus course (at any level) that would consider those local extrema. $\endgroup$ – Jared Mar 31 '16 at 23:02

Let $c\in [a,b]$ be a point where $f$ attains its global minimum value $m$.

Let $A = \{ x \in [a,c] : f(y)=m \text{ for all } y\in [x,c] \}$ and let $a'=\inf A$.

Since $f$ is continuous, $f(a')=m$ and so $a'\in A$ and $A=[a',c]$.

Since $a'$ is a local maximum, there is an interval $I$ around $a'$ such that $f(x)\le f(a')=m$ for all $x \in I$. This implies that $f(x)=m$ for all $x \in I$. Therefore, $a'=a$, because otherwise $I$ would contain a point of $A$ less than $a'$. Thus, $A=[a,c]$.

Analogously, by considering $B = \{ x \in [c,b] : f(y)=m \text{ for all } y\in [c,x] \}$, we get that $b'=\sup B=b$ and $B=[c,b]$.

Therefore, $f$ is constant in $[a,b]$, because $[a,b]=[a,c]\cup[c,b]=A\cup B$ and $f$ is constant, equal to $m$, in $A\cup B$.


Suppose $f$ has local maximum at every $x \in (a,b)$. Let $U \subset (a,b)$ be the open set for which $x$ is a local maximum. Let $y$ be different from $x$ and in $U$. WLOG suppose $y>x$. Suppose $f(x) \not = f(y)$. Let $V$ be the open set for which $y$ is a local maximum. Then on $V \cap U$ both $x,y$ are local maximums. However, $x<y$ and $y \in U \cap V \subset U$ implies $f(x)\geq f(y)$ but $U \cap V \subset V$ and $x<y$ implies $f(x)\leq f(y)$; hence $f(x) = f(y)$. Since this we can do this for any $x \in (a,b)$ we are done i.e $f$ is constant on $(a,b)$.

Remark: A more general statement is that if $X$ is a connected topological space, $f: X \to \mathbb{R}$ is continuous (and $\mathbb{R}$ has the usual topology) and $f$ is local constant, then $f$ is constant.

  • $\begingroup$ What if $V\cap U=\emptyset$? $\endgroup$ – BigbearZzz Mar 31 '16 at 2:51
  • $\begingroup$ @BigbearZzz $y$ was chosen to be in $U$ so there is no way that this can happen. $\endgroup$ – Faraad Armwood Mar 31 '16 at 2:52
  • $\begingroup$ Opps sorry I missed the part. $\endgroup$ – BigbearZzz Mar 31 '16 at 2:53
  • $\begingroup$ @BigbearZzz: No problem. $\endgroup$ – Faraad Armwood Mar 31 '16 at 2:55
  • $\begingroup$ I read your last statement saying that "for any $x,y\in(a,b)$" so I though you mean $x,y$ are arbitrary. $\endgroup$ – BigbearZzz Mar 31 '16 at 2:57

Hint: you need to break the continuity of $f$.

Also, do not assume that $f$ is differentiable -- you can't use that $f'(x) = 0$.


Not the answer you're looking for? Browse other questions tagged or ask your own question.