The function f(x) is defined by:
f(x)=x, if x is rational
f(x)=2x, if x is irrational
Is f continuous?
Now my answer was the following: let a=√2 (any irrational number would do). Then f(a)=2√2. But, as x gets arbitrarily close to a, x is rational, so lim(x->a) of f(x)=√2, which is not equal to f(a), so f is not continuous.
Are there any flaws in my proof? My main question is, can we safely assume that x is rational as we let it get arbitrarily close (but not equal) to a? Thanks in advance, and excuse my failure to use MathJax, but I cannot for the love of me get the mathematical notations to appear.