Difficult Intermediate Value Theorem Problem- two roots

I have been stuck on this Real Analysis problem for hours and am just totally clueless- I am sure it is some application of the Intermediate Value Theorem-

suppose $\ f: \mathbb{R}\rightarrow\mathbb{R} $ is continuous at every point. Prove that the equation $ \ f(x) = c $ cannot have exactly two solutions for every value of $\ c. $

Would appreciate some help

Thanks


Solution 1:

If every value of $f$ occurs exactly once, there is nothing to prove.

Otherwise, let $c$ be such that $f(a)=f(b)=c$ for $a<b$.

If $f$ is constant in $[a,b]$, then we are done, because $c$ is attained at least 3 times.

Otherwise, $f$ attains its maximum $M$ at an interior point $u$ in $[a,b]$. The value $M$ is then a local maximum. (This fails if $M=c$, but in this case take the minimum instead.)

If $f$ does not attain the value $M$ at another point in $\mathbb R$, then we are done.

Otherwise, let $v\ne u$ be such that $f(v)=M$ ($v$ is not necessarily in $[a,b]$).

For small enough $\epsilon>0$, the value $M-\varepsilon$ is then attained at least 3 times: twice near $u$ and at least once near $v$.

Solution 2:

Let $c$ be any value, and let $x < x'$ be the two values satisfying $f(x) = f(x') = c$. Now the midpoint $y = .5(x + x')$ satisfies either $f(y) > c$ or $f(y) < c$. Let us assume the first case, the other case being handled similarly. Let $d := f(y) > c$.

Note that every output value $\alpha$ in the range $(c, d)$ is attained by $f$ in the interval $(x, y)$, and again in the interval $(y, x')$; this holds by two applications of the Intermediate Value Theorem. So all such output values $\alpha$ are attained twice by $f$ in the interval $I := [x, x']$ and, by our original assumption on $f$, they can be attained nowhere outside of that interval. By another application of IVT, this means that $f \leq c$ outside of $I$.

But by a result proved in first-year analysis, the continuous function $f$ must be bounded on the interval $I$, since that interval is closed. Combining this with the above, we find that there is some $C$ such that $f(z) \leq C$ for all inputs $z \in \mathbb{R}$. Then $f^{-1}(C + 1) = \emptyset$. But this is a contradiction to our initial hypothesis about $f$.

Solution 3:

Let $c_1$ such that, $f(x_1)=f(x_2)=c_1$. Take $y_1 = \frac{x_1+x_2}{2}$, and $c_2 = \frac{f(y_1) + c_1}{2}$. Then using the intermediate theorem, you can find $x_3$ and $x_4$ such that $f(x_3)=f(x_4)=c_2$, with $x_3$ strictly between $x_1$ and $y_1$ and $x_4$ strictly between $y_1$ and $x_2$.

That way you create a sequence of $x_n$, $x_{n+1}$ that become closer and closer to one another.

Then if the sequence of $f(x_n)$ converges, then it is bounded (Bolzano Weierstrass), then there is one $c$ that is smaller than the boundary that contradicts $f(x)=c$ has one solution for every $c$.

If the sequence of $f(x_n)$ does not converge, then it goes to infinity which contradicts the continuity of the function.