Let $ f:[a,b]→\mathbb R$ be a function with the following property:
For every $y\in f([a,b])$, you have exactly two $ x_1, x_2 $,such as $f(x_1)=f(x_2)=y$.
Prove that f can not be continuous everywhere.
Let $ f:[a,b]→\mathbb R$ be a function with the following property:
For every $y\in f([a,b])$, you have exactly two $ x_1, x_2 $,such as $f(x_1)=f(x_2)=y$.
Prove that f can not be continuous everywhere.
By the extreme value theorem, $f$ attains its maximum at some point. Then it must attain its maximum at two points: let us name them $x_1 < x_2$. Now, $f$ restricted to the interval $[x_1, x_2]$ must attain its minimum at some point $ x_3 \in (x_1, x_2)$. And there must be some other point $x_4 \in [a, b]$ with $f(x_4)=f(x_3)$. If $x_4 \notin (x_1,x_2)$, then by the intermediate value theorem $f$ must attain the value $\frac{f(x_1)+f(x_3)}{2}$ at least three times. And if $x_4 \in (x_1, x_2)$, let us pick any $x_5$ between $x_3$ and $x_4$: then $f$ must attain $f(x_5)$ at least three times (because it is between $f(x_1)$ and $f(x_3)$).
Hint: assume there is such an f and then it has exactly two absolute minimum points and two absolute maximum points; if say one of the absolute minimum points is strictly inside the interval, show that there are small intervals to the right and left of it which are sent by f to the same interval and then you get a contradiction using the same property for the other absolute minimum point for which there is such a small interval either to the left or right (or both of course if it is inside); so the function must take its absolute minimum at the ends; in the same way it must take its absolute max at the ends and of course f is non-constant so that is impossible
Taking the absolute value or square functions shows that you cannot relax the condition to exclude one point in the interval