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.

  • $\begingroup$ 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. $\endgroup$
    – Ash Pd
    Commented May 14, 2017 at 17:52

1 Answer 1


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

I doubt the point of the question is for you to prove that sin is continuous. It is probably a theorem you are allowed to assume.

  • $\begingroup$ Yes it does specify in the question we may assume such properties of the functions. Thanks for the answer, I forgot about the product of continuous functions. $\endgroup$
    – mrnovice
    Commented May 14, 2017 at 17:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .