Showing Intermediate Value Property Holds 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.
 A: 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.
A: You want to show that for any $a<b$ and $y$ between $f(a)$ and $f(b)$, we have some $a<c<b$ such that $f(c)=y$. Note that this function is continuous on $(-\infty,0)$ and $(0,\infty)$, so if $a$ and $b$ have the same sign then such a $c$ exists by the IVT. Otherwise we have $a\leq 0\leq b$ and one inequality is strict. Assume $0<b$. Let $x$ be such that $\frac{1}{\pi x}<b$. Note that the image of the interval $$\left[\frac{1}{\pi(x+2)},\frac{1}{\pi x}\right]$$ under $f$ is the entire image of $f$, so we have some $c$ in this interval such that $f(c)=y$ as desired. The case $a<0$ is similar.
