If is continuous and is such that f(x)=g(x) for all rational numbers x, is f continuos?

I'm not 100% sure about this because f is clearly continuos on the rationals, but what happens at the irrationals?

EDIT: Being slow today... consider g(x) = 1 (hence cts) and f(x) = 1 for x in Q, and 0 for x in R\Q. f(x) is discontinuous everywhere.