I have a continuous function $f$ over an interval $\left [ a,b \right ]$ such that $f(a)=f(b)$. Also $f$ admits no local extrema over this interval.

I can say that this function reaches a maximum and a minimum over this interval, let's call the maximum $c=f(x_1)$ and the minimum $d=f(x_2)$.

Then $c\neq d$ because otherwise the function would be constant over the interval and every point of it would be a local extremum.

Here's the step that I don't understand: Since $f(a)=f(b)$ we have either $a < x_1 < b$ or $a< x_2 < b$

I don't understand how can we have either of the inequalities alone! If we consider the maximum $c$ for example it couldn't be greater than $f(a)$ or $f(b)$ because then we would have a local maximum so it has to be equal to them and so do all the other points between $a$ and $b$ and we reach the constancy case again. Also why are the inequalities strict?

Thank you very much in advance.

• If both $x_1=a$ or $b$ and $x_2=a$ or $b$ then $c=d$. – André Nicolas Jan 5 '16 at 22:41
• @AndréNicolas Thanks! This explains why the inequalities are strict but what about how we can have either $a < x_1 < b$ or $a < x_2 < b$ alone and fit the properties of $f$? – John11 Jan 5 '16 at 22:52
• Lots of examples, for instance $a=0$, $b=1$, $f(x)=x(1-x)$. The mins are at the two ends, and there is a local max at $x=1/2$. Of course there is a local max strictly in between, but after all we are proving that it is impossible for a non-constant function to be equal at both ends and to have neither a local max nor a local min. – André Nicolas Jan 5 '16 at 22:55
• No non-constant function fits. As I said, that is what you are proving. – André Nicolas Jan 5 '16 at 22:59
• I hesitate to write an answer, since it would be essentially the same as the one you posted. Proofs by contradiction can be difficult to follow, since we are assuming something that is not so. The logic is (i) if there were a non-constant function with no local extrema then both extrema would be at the ends. But (ii) the values at the ends are the same, so the max and min are the same and therefore (iii) the function is constant. – André Nicolas Jan 5 '16 at 23:15