# A problem on discontinuous function

a function $f:\mathbb{R}\rightarrow \mathbb{R}$ has at least one local min and at least one local max. Also all its local max values are less than its local min values. (i.e. if $f$ attains local max at $a$, and local min at $b$, then $f(a) < f(b)$). Show that $f$ must be discontinuous. Is it true?

-
0% accept rate? Do you know about accepting answers to your questions? –  Gerry Myerson Apr 2 '12 at 5:54
No Dear Sir.What is that? –  Bunuelian Trick Apr 2 '12 at 5:55
@MimMim if someone answers your question to your satisfaction, you must click the green check mark next to the answer so that person gets credit. Otherwise, no one will answer your questions anymore. –  Parsa Apr 2 '12 at 6:28
Imagine if your function is continuous. Suppose $f$ hits it local max at $a$. By definition of local max, in an interval $I$ containing $a$, $f(x)<f(a)$ for all $x \in I$. Now, if $f(b)>f(a)$ for a local min at $b$, show there had to have been another local min $c$ with $f(c)<f(a)$. –  Parsa Apr 2 '12 at 6:35
Concerning accepting answers,you can see some useful information at math.stackexchange.com/faq#howtoask, also see the discussion at meta.math.stackexchange.com/questions/3399/…. –  Gerry Myerson Apr 2 '12 at 7:02
show 1 more comment

The reasoning by @Parsa has a minor omission; however it is easily repaired. The issue concerns the definition of local extrema. The definition of local min at $a$ is that there is an open interval $I$ containing $a$ such that $f(x) \ge f(a)$, $\forall x \in I$ (ie, the inequality is not strict).
However, since all local max values are strictly less than the local min values, this means that if $f$ is continuous, then no other point in $I$ (other than $a$) can have the value $f(a)$ (for either a max or a min). To see this, suppose $a$ is a local min, and that $a' \in I$ also satisfies $f(a') = f(a)$. Then $f$ must have a local max between $a$ and $a'$ whose value is not strictly less than $f(a)$, which is a contradiction. Consequently, $f(x) > f(a)$, $\forall x \in I \setminus \{a\}$. The same reasoning applies to a local max, mutatis mutandis.