Here's the problem:
Define $h: \mathbb{R} \to \mathbb{R}$ by

Prove $h$ is continuous at $0$.
Usually, I have a good idea how to prove this when the cases are $x=0$ and $x\neq0$, but I'm a bit thrown off here since it says $x$ is rational/irrational. Can someone help explain this problem to me?
I think I'm supposed to use $\epsilon-\delta$ proof, but I'm not sure.
Hint:
$$\left|x\sin\frac1x\right|\le|x|\to 0$$