Continuity of a piecewise function at a specific point

I am having trouble proving the following function is not continuous at $x = 0$ using a formal definition of continuity.

$f(x) = \left\{ \begin{array}{lr} \sin(\frac{1}{x}) & : x \neq 0\\ 0 & : x = 0 \end{array} \right.$

It is easier using the definition $f$ is continuous at $a$ if $x_n \to a$ then $f(x_n) \to f(a)$. So to prove discontinuity you just need to come up with a sequence $(x_n)$ which converges to $a$ but the corresponding sequence, $\left({f(x_n)}\right)$ does not converge to $f(a)$.
The sequence $\left({\dfrac{2}{n \pi}}\right)$ would do.
It simply doesn't have limit at $x=0$ and this can be shown easily using Heine's definition of limit.
Take $\epsilon = \tfrac12$. To prove continuity at $x=0$, we would have to find some $\delta>0$ such that $|f(x)| < \epsilon$ whenever $|x| < \delta$. So, take some $\delta$ that we think might be suitable. Choose an odd integer $n$ such that $n>\frac{2}{\pi\delta}$, and let $x = \frac{2}{n\pi}$. Then $|x| < \delta$ and $f(x) = \sin(1/x) = \sin n\pi/2 = 1$. So, no matter what $\delta$ we choose, we can always find $x$ with $|x| < \delta$ and $|f(x)| = 1$.
In plain English, rather than $\epsilon$-$\delta$ jargon: we have $f(0)=0$, but there are arbitrarily small values of $x$ for which $f(x)=1$, so there is no hope of continuity.
• Yes, you're right. Or, we could just just make sure that we choose $n$ to be odd. I modified my answer. – bubba Mar 22 '15 at 14:59