Here's the question:
Let $f(x)=\sin \left( \frac{1}{x} \right)$ for $x\ne 0$ and let $f(0)=0$. Show that $f$ is discontinuous on $\mathbb{R}$ and still has the intermediate value property on $\mathbb{R}$.
It's easy to show that $f$ is discontinuous at $x=0$. Now, I go on to prove that $f$ has the intermediate value property. Let $a,b \in \mathbb{R}$ with $a<b$. Assume that $y$ be some real such that $f(a) < y < f(b)$. If $y=0$ we are done for $f(0)=y$. If $y\ne 0$, I was hoping to use the continuity of sine on $\mathbb{R}$ but nothing seems work out.
Hints would be appreciated. I do not need full solution.