Let $g(x)$ be: \begin{cases} 0 \space\space \text{if}\space\space x \in \mathbb Q \\ x\space\space \text{if} \space\space x \in \mathbb R - \mathbb Q \\ \end{cases}
I know this function is continuous at $x = 0$ only, so I want to prove, using the negation of $\varepsilon - \delta$ definition, that $g$ is not continuous anywhere else.
$\lim\limits_{x\to a} g(x) \ne g(a)$ means that
$\exists \varepsilon \gt 0, \space\space \forall \delta \gt 0 \space\space$ such that $\space\space$ $0 \lt |x - a| \lt \delta \land |g(x) - g(a)| \ge \varepsilon$
Set $\varepsilon = \frac {|a|} 2$
Let $a \in \mathbb Q$ and select a $x \in (a-\delta, a + \delta) \cap \mathbb R - \mathbb Q$. Such $x$ exists due to irrational numbers being dense in $\mathbb R$.
$|g(x) - g(a)| = |x| \ge \frac {|a|}2$. Since, from the definition, we just need to show that there exists at least one $x$ inside $(a - \delta, a + \delta)$, to satisfy the inequality, choose a $x \gt \frac {|a|}2$.
Thus, $|x| \ge \frac {|a|}2$ holds. There's no rational number, except for $0$, where $g$ is continuous at.
For the second case, let $a \in \mathbb R - \mathbb Q$ and $x \in (a-\delta, a + \delta) \cap \mathbb Q$. The same explanation for the first part can justify the existence of such a $x$.
$|g(x) - g(a)| = |0 - a| = |-a| = |a| \ge \frac {|a|}2$. Then, there's no irrational number where $g$ is continuous at.
Is this correct?