$ f(x) = { 0,}$ if $x$ is rational.
$f(x) = \sin(x)$ if $x$ is irrational.
Find the limit at $x = 0$.
Recall a similar example in a lecture where two sequences were used to solve. Not sure if this is relevant to this example and or how to solve it.
We are trying to prove that $$\lim_{x\to 0}\:f(x) = 0$$ According to the Squeeze Theorem, if $g(x) \le f(x) \le h(x)$ and $\lim_{x\to a} g(x) = \lim_{x\to a} h(x) = L$, then $\lim_{x\to a} f(x) = L$. In our formula, we get $$0 \le f(x) \le \sin(x)$$ when approaching from the right, and $$\sin(x) \le f(x) \le 0$$ when approaching from the left. Although we can continue from here, we can also write this in a format that will directly fit the format. Let's define the two piecewise functions $$g(x) = \begin{cases} \sin(x) & \text{if $x < 0$} \\ 0 & \text{if $x \ge 0$} \end{cases}$$ $$h(x) = \begin{cases} 0 & \text{if $x \le 0$} \\ \sin(x) & \text{if $x > 0$} \end{cases}$$ This way, on an interval $x \in [-\pi, \pi],$ $$g(x) \le f(x) \le h(x)$$ meaning we may continue. $$\lim_{x\to 0}\:g(x) = 0$$ $$\lim_{x\to 0}\:h(x) = 0$$ $$\therefore$$ $$\lim_{x\to 0}\:f(x) = 0$$ The same method can be used to prove that $$\lim_{x\to k\pi}f(x) = 0,\, k \in \mathbb{Z}$$ Although, I will leave you to prove that if you wish.