TITLE: Continuity of $f(x)= x\cos 1/x$ when $x\neq 0$, and $0$ otherwise
QUESTION [5 upvotes]: Is the following function continous on $\mathbb R$?
$f(x)=\begin{cases}\begin{align} &x\cos \frac 1x &  x\neq 0 \\ 
&0 & x=0 \end{align}\end{cases}$
I tried to derive it and show the limit from both 0+ and 0- are 0 but I get to infinity plus infinity and such expressions.
This is the derivative: $\frac 1x\sin\left(\dfrac{1}{x}\right)+\cos\left(\dfrac{1}{x}\right)$
Maybe this function isn't continous at all ?

REPLY [7 votes]: It is well known, that
$$\left|\cos{a}\right|\leq 1$$
for every $a\in\mathbb{R}$
Thus, the following holds:
$$\left|x\cos{1/x}\right|\leq \left|x\right|\cdot\left|\cos{1/x}\right| \leq\left|x\right|\cdot 1 = \left|x\right|$$
Thus
$$\lim_{x\rightarrow 0} f(x) = 0 = f(0) $$
which means that $f$ is continous at $x=0$