In my analysis textbook, there is an exercise that states:
Exercise. Let $f$ be a continuous function defined on the interval $(0,1)$ to the real numbers, such that $\lim_{x\to 0} f(x)=0$ and $\lim_{x\to 1} f(x) = 0$.
Show $f$ achieves either an absolute minimum or an absolute maximum on $(0,1)$ but perhaps not both.
My question is, why is it 'perhaps not both'? For example, if I defined a function on $(0,2\pi)$ and let $f(x) = \sin(x)$, then wouldn't the function have both an absolute maximum and minimum?
That “perhaps not both” means that sometimes such a function has a maximum but not a minimum or a minimum but no a maximum. Take $f(x)=x-x^2$, for instance. It has a maximum, but not a minimum.