TITLE: I want to make sure my proof is correct using $\epsilon, \delta$ definition of continuity for $\sin\left(\frac{1}{x}\right)$
QUESTION [5 upvotes]: So, let's consider the function
$$
f(x)=\begin{cases}
\sin\left(\frac{1}{x}\right) & x\neq 0 \\
0 & x=0
\end{cases}
$$
I want to prove the above function is discontinuous at $x=0$.
Let $\epsilon=\frac{1}{2}$. And let's consider $x_n=\frac{2}{(4n+1)\pi}$. Suppose $ \frac{2}{(4n+1)\pi} < \delta$ for $\delta>0$. If the function were continuous we should have $|f(x_n)-0|<\epsilon$. But clearly $f(x_n)=1$ for all n, then we have $|f(x_n)|>\epsilon=\frac{1}{2}$. Thus, the function isn't continous at x=0. Is it correct?

REPLY [3 votes]: The idea of the proof is correct, but a little bit of wording might be needed. You can't say "Suppose $\frac{2}{(4n+1)\pi} < \delta$, as maybe there exists $\delta \le \frac{2}{(4n+1)\pi}$, which is suitable for our $\epsilon$. Anyway the best way to do it is by contradiction.
Let $\epsilon = \frac 12$ and assume the function is continuous at $x=0$. Then there exists a suitable $\delta > 0$ s.t. $|x| < \delta \implies |f(x)| < \epsilon$. Now using the Archimedian Principle we have that there is an integer $n$, s.t. $n > \frac{1}{2\delta \pi} - \frac 14$. Hence we have that $\frac{2}{(4n+1)\pi} < \delta$ and so we must have: $\left|f\left(\frac{2}{(4n+1)\pi}\right)\right| \le \frac 12$, but this is wrong as shown. Hence $f$ is discontinuous at $0$.