Let $a$ be irrational, so $f(a) = 0$.
Consider the $\epsilon,\delta$ definition of continuity. Practically speaking, if the function $f$ is continuous at $a$, then given any small $\epsilon$, there is some small neighborhood $(a-\delta,a+\delta)$ so that all the values of $|f(x)|$ are less than $\epsilon$ (since $|f(x) - f(a)| = |f(x)|$).
But any such neighborhood of $a$ contains infinitely many rational numbers (where the values of $f$ will range from $a-\delta$ to $a + \delta$). So, if you choose an $\epsilon < a$, then no matter what $\delta$ you choose, there's some rational $x \in (a-\delta,a+\delta)$ so that $f(x) > a$.
You can basically use the same kind of argument to examine the rational points; choose rational $b$, choose $\epsilon < b$, get the contradiction. Notice that there's one rational number which this argument won't work though (why?). That will be the sole point of continuity.
Once you understand the first example, the second is the same thing with a slight twist.