# Show that $f(x) =x\sin(1/x)$ if $x>0$, $f(x)=0$ if $x\leq 0$, is continuous

How to show that the following function is continuous: $$f(x) = \cases{x\sin\frac{1}{x}\quad x>0\\ 0\quad\quad \quad\,\,x\leq 0}$$

$f(x)$ is continuous at $x=a$ iff $$\forall \epsilon >0,\quad\exists\delta:|x-a|<\delta\implies|f(x)-f(a)|<\epsilon$$

I split it into $2$ cases, for $a\leq 0$:

Fix $\epsilon >0$. Then define $\delta:= \epsilon$. We then suppose $|x-a|<\delta$.

$|x-a|<\delta =\epsilon\implies |f(x)-f(a)|=|f(x)|=|x\sin\frac{1}{x}|\leq |x|\leq \epsilon -a<\epsilon$ as required.

For $a>0$, again I fix $\epsilon >0$, and define $\delta:=\epsilon$

Suppose $|x-a|<\delta=\epsilon$. Then we have $|f(x)-f(a)| = |x\sin\frac{1}{x}-a\sin\frac{1}{a}|$, and also $|x\sin\frac{1}{x}|\leq |x|$ (similar is true for $a$).

I'm not sure how to proceed here, I need to show that $|f(x)-f(a)|<\epsilon$. Could someone please offer some tips? Also in the highly possible event I've made some mistakes, feel free to ignore everything I've written when responding lol.

• Sine function is bounded whatsoever the largest x be it will be a finite value between -1 to 1, so u could just assume it has some finite number apply algebra of limit. Commented May 14, 2017 at 17:52

You have already done the "hard" part of showing the function is continuous at its "weird" point $x=0.$ So you you're on the part where you need to show it for $x>0.$
For this you all you need to know is that the $\sin$ function is continuous. Then, since $x$ and $\sin(x)$ are continuous everywhere and and $1/x$ is continuous at any nonzero value, you're done by the theorems for compositions and products of continuous functions. The only place where this doesn't work is $x=0$ (since $1/x$ is not continuous there) but you've already handled that case