Let $ f: \mathbb{R} \rightarrow \mathbb{R} $ be defined by
\begin{align} f(x)=x^{2} \ \ if \ \ x \in \mathbb{Q}, \\ f(x)=x+2 \ if \ x \in \mathbb{Q^{c}} \end{align} . Find out the points where f is continuous, if any.
My approach- let $ x_{n} \in \mathbb{Q}$ and $ x_{n} \rightarrow x_{0} $ . Then $ f(x_{n})=x_{n}^{2} \rightarrow x_{0}^{2} $. Now if $ x_{n} \in \mathbb{Q} $ , then $ x_{n} \rightarrow x_{0} $ implies $ f(x_{n})=2+x_{n} \rightarrow 2+x_{0} $. Hence f will be continuous if $ \ x_{0}^{2}=2+x_{0} \ \ or, x_{0}=2,-1 $. Hence f is continous at 2, -1 . Is is true ? Any help is there