If you click on the link in the OP, it goes quite explicitly through all that. More importantly, besides explaining how such a function can be continuous only at irrational numbers, as summarized in this thread, it explains why there is no function continuous at rational numbers but discontinuous at irrationals, for instance.