We have to prove that f(x) is constant.
Let us to this by contradiction. Assume that f(x) takes two different values for different x.
Let these values be a and b(>a)
Since f(x) is continuous so it will assume all values between a and b, including the irrational ones.
Which is not possible. Thus f(x) must be constant.
i.e. f(x) =1 for all x in [0,3]