For 2:

Consider the sequence such that .

If then . This is because if x is rational take each to be irrational, and vice-versa if x is irrational.

For the second part, since f is only continuous at 0, this is the only point that it can possibly be differentiable. Now equals 0 is is irrational and 0 if is rational. So from this we see that .