TITLE: Showing Intermediate Value Property Holds
QUESTION [9 upvotes]: Let $$f(x)=\begin{cases}
\sin \tfrac 1 x &\text{if $x\ne 0$}\\
0 & \text{if $x = 0$.}\end{cases}$$
I have to show that $f$ has the intermediate value property. That is, for any $a < b$, if $y$ is any real number such that $f(a) < y< f(b)$ or $f(a)>y> f(b)$, then there exists a $c \in (a,b)$ such that $f(c)=y$.
I feel like I kind of know how to go about completing this. I just am curious as to if I have to create a bound such as letting $a = -1$ and $b = 1$, or keep $a$ and $b$ both arbitrary.

REPLY [2 votes]: Here is funny - although not recommended - argument.
As is well-known, although the graph of $f$ is not path-connected, it is connected: that's indeed the typical example of a connected non path-connected space.
In particular, the graph $G$ of every restriction of $f$ to any $[a,b]$ is connected.
Now the range of $f$ restricted to $[a,b]$ is the continuous projection of $G$ under $(x,y)\longmapsto y$. So it is a connected subset of $\mathbb{R}$, i.e. an interval.
Note: how to prove the graph $G$ of $f$ restricted to $[a,b]$ is connected? It works nicely, for instance, with the following characterization of connectedness: every continuous function from $G$ to $\{0,1\}$ discrete is constant.