Continuity with dense sets? so I am given the function $f(x)=\begin{cases} 2x+1 \quad \quad  \quad  \quad , \text{if } x\in \mathbb{Q} \\ -2x^2+3x+4 \, \, \,,  \text{if } x\notin \mathbb{Q}\end{cases}$. I have already proven with $\varepsilon \delta$, that it is continuous in $x_0=-1$ and $x_1=3/2$. I am now trying to prove that for any $\tilde{x}\in \mathbb{R}\backslash \{-1,3/2\}$, it is not continuous. 
My attempt using the epsilon-delta-definition:
I suppose I have to use the fact that $\mathbb{Q}$ is dense in $\mathbb{R}$ and vice versa. Or is it better to use the sequence definition?
 A: Assume that $f$ is continuous on the set $A:=R \setminus \{-1,3/2\}$ and $x \in A $
Then exists $q_n \in Q$ and $r_n \in Q^c$ such that $r_n \to x$ and $q_n \to x$
Thus by assumption $f(q_n) \to f(x) $ and $f(r_n) \to f(x)$ 
So by uniqueness of limit we 'll have  $-2x^2+3x+4=2x+1$ 
Thus $-2x^2+x+3=0$
Can you reach tha contradiction now?
A: Let's generalize a bit! Suppose that $f_1,f_2$ are continuous maps and
$$f(x)=\begin{cases} f_1(x) & x\in \mathbb{Q} \\
f_2(x) & x \notin \mathbb{Q}\end{cases}$$
Let's prove that $f$ is continuous at $x_0$ if $f_1(x_0) = f_2(x_0)$ and not continuous otherwise.
Suppose that $f_1(x_0) = f_2 (x_0)$
Take $\epsilon >0$. By definition it exists $\delta_1$ such that for $\vert x- x_0 \vert < \delta_1$ you have $\vert f_1(x) - f_1(x_0) \vert < \epsilon$. It exists also $\delta_2$ with similar inequalities for $f_2$. Now take $\delta = \min\{\delta_1, \delta_1\}$. For $\vert x - x_0 \vert < \delta$, you have $\vert f(x) - f(x_0) \vert < \delta$ proving continuity at $x_0$.
Now suppose that $f_1(x_0) \neq f_2 (x_0)$
Suppose that $x_0 \in \mathbb Q$. The sequence $y_n= x_0+\frac{\sqrt{2}}{n}$ is a sequence of irrationals converging to $x_0$. Therefore:
$$\lim\limits_{n \to \infty} f(y_n) = f_2(x_0) \neq f_1(x_0) = f(x_0)$$
proving that $f$ is not continuous at $x_0$.
And if $x_0 \notin \mathbb Q$, get a similar conclusion considering the sequence of rationals $z_n=x_0+1/n$.
