Method checking to show function is discontinuous at x=0 Let $f:[0, \pi] \rightarrow \mathbb{R}$ be defined by $f(0)=0$ and $f(x)=x \sin \frac{1}{x}-\frac{1}{x} \cos \frac{1}{x}$ for $x \neq 0$. Is $f$ continuous ?

my method was that x $\sin \frac{1}{x}$ has limit value as zero as x tends to zero . So we can focus on just the  $\frac{1}{x} \cos \frac{1}{x}$ , that term is having the form if infinity * some number between -1 and 1 , both inclusive , so we can say its indeterminate hence limit doesnt exist ? Or we cannot do this method as when we apply partwise limit check we need to ensure both limit exists?

 A: It is a mistake to say the function  'is indeterminate' – the expression you're considering is defined for $x\ne 0$, where $\frac 1x$ is well defined, its cosine $\cos\frac 1x$ is well defined and their product is well defined, too.
You should rather point out that cosine's range $[-1,1]$ (not $[0,1],$ btw) allows values of the subexpression to reach from $-\frac 1{|x|}$ to $\frac 1{|x|}$, which gets unbounded when $x$ approaches zero.
That implies $f$ is unbounded around $x=0$ which breaks the condition in the limit's definition.
As a result, $f$ has no limit at $x=0.$
A: In order for
$$
f(x) = \begin{cases}
x \sin \left(\frac{1}{x}\right)-\frac{1}{x} \cos \left( \frac{1}{x}\right) & x\neq0 \\
0 & x=0
\end{cases}
$$
to be continuous at $x=0$, we must have
$$
\lim_{x\to0}f(x) = 0.
$$
In particular, we must have
$$
\lim_{n\to\infty}f(x_n) = 0,
$$
for every real sequence $(x_n)$ that tends to zero.
Now, consider $\displaystyle x_n = \frac{1}{2n\pi}$. Note that
$$
f\left(\frac{1}{2n\pi}\right) = \frac{1}{2n\pi}\,\sin(2n\pi) + 2n\pi\cos(2npi) = 2n\pi \not\to 0.
$$
Thus, for this particular sequence satisfying $x_n\to0$, we don't have $f(x_n)\to0$. Thus, $f$ is not continuous at zero.
