Study the continuity of $f$ at $0$ using the sequential definition of limit If $  f(x) =
\begin{cases}
1 & \text{if $x \in \mathbb{R} \setminus \mathbb{Q}$} \\
0, & \text{if $x \in \mathbb{Q}$}
\end{cases}$
To use the sequential definition of limit, we will have to choose an $(x_n)$. How can I imagine what this $(x_n)$ will be?
 A: TL;DR
Hey look the function says $\mathbb Q$ and $\mathbb R \setminus \mathbb Q$. Let's consider a rational sequence $r_n \to 0$ and an irrational sequence $i_n \to 0$.
Rational:
$$f(r_n) = 0 \implies f(r_n) \to 0$$
No problem there.
Irrational:
$$f(i_n) = 1 \implies f(i_n) \to 1 \ne 0$$
Hence $f$ is not continuous at $x=0$


Definition (or Property, depending on the textbook): $f$ is continuous at $x=a$ if (or iff, for property) $f(a)$ is defined and for any sequence $x_n \to a$, $f(x_n) \to f(a)$

So $f$ is continuous at $x=0$ if (or iff, for property) for any sequence $x_n \to 0$, $f(x_n) \to f(0)=0$.
Hence, if we find some sequence $\{x_n\}$ s.t. $x_n \to 0$, but we do not have $f(x_n) \to 0$, then $f$ is not continuous at $x=0$.
So let's try out some $\{x_n\}$'s. What are some sequences that converge to zero?
$$x_n = \frac1n$$
$$x_n = \frac2n$$
$$x_n = \frac3n$$
For any of those we have $f(x_n) = 0 \ \forall n$ and hence $f(x_n) \to 0$
So what about other $\{x_n\}$'s?
Well in the first place we had $f(x_n) \to 0$ because $f(x_n) = 0$ because our $\{x_n\}$'s were rational sequences. Hopefully, it is clear that for any rational sequence $\{r_n\}$, we have $f(r_n) = 0$ and hence $f(r_n) \to 0$.
So what about irrational sequences $\{i_n\}$ s.t. $i_n \to 0$ eg $i_n = \frac{\pi}{n}$?
Well $f(i_n) = 1 \ \forall n$ and so $f(i_n) \to 1 \ne 0$.
Hence we have found a sequence, namely any irrational sequence, s.t. we do not have $f(x_n) \to f(0)=0$
Hence $f$ is not continuous at $x=0$.

Actually the function is the indicator/characteristic function on the irrationals, and it is 1 minus the indicator/characteristic function on the rationals aka the Dirichlet function. Both functions are nowhere continuous.
Pf:
Let $f$ be indicator/characteristic on either rationals or irrationals. Let us see if $f$ is continuous at $x=a$. Now, $a$ is either rational or irrational. Hence, $f(a)$ is either 0 or 1 (eg $f(a)=0$ if $a$ is rational and $f$ is indicator/characteristic on irrationals).
Consider a rational sequence $\{r_n\}$ and an irrational sequence $\{i_n\}$. We have:
$$f(r_n) \to f(a) \iff f(i_n) \to 1-f(a)$$
QED
