For a beginner here is a different proof.
If a continuous function is not zero at a point then there is an open interval containing the point on which the function has the same sign (either positive or negative throughout the interval). But every interval contains a rational number.
So this function has to be zero everywhere.