suppose that the function g:R->R is continuous and that g(x)=0 if x is rational. Prove that g(x)=0 for all x in R.
-- I am totally stuck on this one.
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.