$f(x)= \left\{ \begin{align} 2x+1 \quad \text{if } x\in \mathbb{Q} \\ -2x^2+3x+4 \quad \text{if } x \notin \mathbb{Q} \end{align} \right.$
Show that $f$ is continuous in $x_0=-1$
Here's my attempt:
(i) $x\in \mathbb{Q}$
For every $\varepsilon >0$, find $\delta_1>0$, such that for all $x_0, x\in \mathbb{Q}$: $|x-x_0|<\delta_1 \implies |f(x)-f(x_0)|<\varepsilon $
$\Leftrightarrow |x+1|<\delta_1 \implies |2x+2|<\varepsilon$
Since $|2x+2|=2|x+1|<\varepsilon$, choose $\delta_1 := \varepsilon /2$.
(ii) $x\notin \mathbb{Q}$
For every $\varepsilon >0$, find $\delta_2 >0$, such that for all $x,x_1\notin \mathbb{Q}$ gilt:
$|x+1|<\delta \implies |-2x^2+3x+5|<\varepsilon $
We have $|-2x^2+3x+5|=|-(x+1)\cdot (2x-5)|=|x+1|\cdot |2x-5|<\delta \cdot |2x-5|$.
How do I get rid of the $x$?
Hint
when $|x+1|<\delta$ then for sufficiently small $\delta>0$ we have $$6<|2x-5|<8$$