Show $f(x)=2x \sin{\frac{1}{x} -\cos{\frac{1}{x}}}$ is discontinuous at $0$

Show $$f$$ is disconinuous at $$0$$ where $$f$$ is:

$$f(x)= \begin{cases} 2x \sin{\frac{1}{x} - > \cos{\frac{1}{x}}}&\text{if}\, x \neq 0\\ 0&\text{if}\, x=0 > \end{cases}$$

Suppose $$f$$ is continuous at $$0$$ then $$\forall \epsilon \gt 0$$, $$\exists \delta \gt 0$$ s.t. $$\left| f(x)-f(0) \right| \lt \epsilon$$ whenever $$|x-0| \lt \delta$$.

Choose $$\epsilon = \frac{1}{2}$$, then by hypothesis $$\exists \delta \gt 0$$ s.t. the above condition is true.

Now pick $$x = \frac{1}{n \pi}$$ where $$n \in \mathbb{N}$$ is some natural number. Then $$x \gt 0$$.

For a sufficiently large $$n$$, $$|x-0| = x \lt \delta$$.

But $$f\left(\frac{1}{n \pi}\right)$$ $$=\frac{2}{n \pi} \sin{(n \pi)} - \cos{(n \pi)}$$ $$=0 - (-1)^n = (-1)^{n+1}$$

So $$|f(x) - f(0)| = |(-1)^{n+1}-0|=1 \gt \frac{1}{2}$$ which is a contradiction. Hence, $$f$$ must be discontinuous at $$0$$.

$$\Box$$

I would like some alternative proofs, as well as comments or suggestions to my proof.

We have $$f(0)=0$$. So to show that $$f$$ is not continuous at $$x=0$$, it is enough to show that it is not true that $$\lim_{x\to 0} f(x)= 0$$.

Suppose to the contrary that the limit exists and is equal to $$0$$. Then for any $$\epsilon\gt 0$$, there is a $$\delta\gt 0$$ such that if $$|x|\lt\delta$$, then $$|f(x)|\lt\epsilon$$.

Pick $$\epsilon=\frac{1}{2}$$. We show there is no $$\delta$$ with the required property.

If $$x\lt 0$$, then $$f(x)\lt 0$$. In particular, if $$x\lt 0$$, then $$|f(x)|\gt 0$$. It follows that there is no $$\delta$$ such that $$|x|\lt \delta$$ guarantees that $$|f(x)|\lt \epsilon$$.

Hint: Continuity can be proved using limits as well. For instance, $$\sin(\frac{1}{x})$$ is bounded, so what can be said about $$x\sin(\frac{1}{x})$$ when $$x \to 0$$? What about the second term, $$\cos(\frac{1}{x})$$?

• $x \sin{(1/x)} \to 0$ and $\cos{(1/x)}$ oscillates between -1 and 1. So how do we formalize the argument? By simply saying the limit $\cos{(1/x)}$ does not exist? Or can we say something more concrete?
– Sun
Nov 7, 2019 at 3:10
• You know f(0)=0, f would be continuous if both left and right side limits were zero. Nov 7, 2019 at 3:20