Prove that $f:[0,\infty)\to\mathbb{R}$ where $f(x) := {1\over x}\cos({1\over x}),x>0$ ,does $f$ has the intermediate value property on $[0,\infty)$? Prove that $f:[0,\infty)\to\mathbb{R}$ where $f(x) := {1\over x}\cos({1\over x}),x>0$ does $f$ has the intermediate value property on $[0,\infty)$?
Attempts: In $\mathbb{R}$, if $f$ is continuous then it has intermediate value property and as we know ${1\over x}\cos({1\over x})$ are continuous  on  $\mathbb{R}$ so it has the intermediate value property but it doesn't seem to be that straight forward.
 A: The function $f\colon [0,+\infty)\to \mathbb R$
$$
f(x) = \begin{cases}
      \frac {1}{x} \cos \frac 1 x & \text{if $x>0$}\\\\
      0 & \text {if $x=0$}
      \end{cases}
$$
is not continuous but has the intermediate value property. In fact given two points $a,b \in [0,\infty)$ with $a<b$ you have two possibilities:


*

*$a>0$. In this case notice that the function is continuous on $[a,b]$ hence it has the property

*$a=0$. In this case you should notice that it is possible to find $\epsilon<b$ such that $f(\epsilon)=0$ (see where $\cos(1/x)=0$). Since $f$ is continuous on $[\epsilon,b]$ you can apply the intermediate value theorem there.

A: This answer is motivated by a question in the comments from the OP @Mathematics.
Note that $\cos(2\pi n)=1$ and that $\cos(2\pi n + \pi) = -1.$ It follows that the function $f(x)=(1/x) \cos(1/x)$ (with $x>0$, we don't need a definition of $f(0)$ for this approach) has the following particular values:
$$f(1/(2 \pi n))=2 \pi n,$$
$$f(1/(2 \pi n + \pi))=-(2 \pi n + \pi).$$
So given any real number $c$ we can choose $n$ large enough so that $c$ lies in the open interval $I_n=(-(2\pi n + \pi), 2 \pi n).$ By the intermediate value theorem $f(x)=c$ for some $c \in I_n.$ So we can say that $f(x)$ takes on every real number value near (but no need for at) $0$. And looking at the above sequence of intervals $I_n$ we can in fact say that $f(x)$ takes on every real number infinitely often.
