# 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.

-
You write $f : [0, \infty) \to \mathbb{R}$ but you only define $f(x)$ for $x > 0$. Is $f$ defined at $0$? –  Michael Albanese Feb 2 '13 at 8:39
@MichaelAlbanese well, the question didn't mention, but actually any value is not a matter –  Mathematics Feb 2 '13 at 8:45
Near zero, $f$ takes on arbitrarily large positive values, immediately after or before taking on arbitrarily "large negative" values, meaning negative with large absolute value. Use the intermediate value theorem to get your result. –  coffeemath Feb 2 '13 at 8:48
@Mathematics: That is true, but if you don't know how to solve this problem, it isn't clear how you know that it doesn't matter what $f(0)$ is. On the other hand, it does matter that $f(0)$ is something. Just so we're all talking about the same thing, could you please choose some value for $f(0)$? –  Jonas Meyer Feb 2 '13 at 8:52
@JonasMeyer I guess choosing $f(0)=0$ would still work. –  Mathematics Feb 2 '13 at 8:56

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:

1. $a>0$. In this case notice that the function is continuous on $[a,b]$ hence it has the property
2. $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.
-

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.

-
If $f(0)$ isn't defined, then the domain of the function is $(0,\infty)$, and it is continuous there. Every continuous function on an interval has the intermediate value property. Every choice of definition for $f(0)$ will work, which perhaps is what is meant. For all $b>0$, $f((0,b))=\mathbb R$, so there is no problem hitting everything between $f(0)$ and $f(b)$, whatever $f(0)$ may be. –  Jonas Meyer Feb 2 '13 at 20:50