Using sequential approach to prove $\sin(\pi x)$ is only continuous when $x$ is an integer Let $f(x) = \sin(\pi x)$ when $x$ is rational number, $f(x) = 0$ when $x$ is irrational number. Prove ,by the sequential approach, that the function $f$ is only continuous at $x$ when $x$ is integer.
I would like to ask how do we do this using the sequential approach? I am stuck at how to define the sequence of $x$ in the above question. This is a past test question that I am looking at for revision. Thank you.
 A: Let's generalize a bit! Suppose that $f_1,f_2$ are continuous maps and
$$f(x)=\begin{cases} f_1(x) & x\in \mathbb{Q} \\
f_2(x) & x \notin \mathbb{Q}\end{cases}$$
Let's prove that $f$ is continuous at $x_0$ if $f_1(x_0) = f_2(x_0)$ and not continuous otherwise.
Suppose that $f_1(x_0) = f_2 (x_0)$
Take $\epsilon >0$. By definition it exists $\delta_1$ such that for $\vert x- x_0 \vert < \delta_1$ you have $\vert f_1(x) - f_1(x_0) \vert < \epsilon$. It exists also $\delta_2$ with similar inequalities for $f_2$. Now take $\delta = \min\{\delta_1, \delta_1\}$. For $\vert x - x_0 \vert < \delta$, you have $\vert f(x) - f(x_0) \vert < \delta$ proving continuity at $x_0$.
Now suppose that $f_1(x_0) \neq f_2 (x_0)$
Suppose that $x_0 \in \mathbb Q$. The sequence $y_n= x_0+\frac{\sqrt{2}}{n}$ is a sequence of irrationals converging to $x_0$. Therefore:
$$\lim\limits_{n \to \infty} f(y_n) = f_2(x_0) \neq f_1(x_0) = f(x_0)$$
proving that $f$ is not continuous at $x_0$.
And if $x_0 \notin \mathbb Q$, get a similar conclusion considering the sequence of rationals $z_n=x_0+1/n$.
You can apply this result to $f_1(x) = \sin \left(\pi x \right)$ and $f_2(x) = 0$.
