For example, finding the limit for $f(x)$ where $$f(x) = \begin{cases} e^{x^2}-1 &x\in\mathbb{Q} \\ 0 &x\notin\mathbb{Q} \end{cases}$$
I had a hunch that you had to use the sandwich theorem with $0$ on either side of $e^{x^2}-1$ however I do not know how to formally show this.
Denote $g(x) = e^{x^2} - 1$, for $x \in \mathbb{R}$. $g$ is continuous and $g(0) = 0$.
$\forall \varepsilon > 0$, $\exists \delta > 0$ such that $| g(x ) | < \varepsilon$, for any $|x| \leq \delta$.
Using the same $\delta$, we write $| f(x) | < \varepsilon$, for any $|x| \leq \delta$.
Indeed, if $x \in \mathbb{Q}$, then $g(x) = f(x)$ and, for $x$ irrational, $| f(x) | = 0 < \varepsilon$.