Prove continuity of a simple polynomial Suppose $f(x)=8x, x\notin \mathbb{Q}$ and $f(x)=2x^2 +8, x\in \mathbb{Q}$
Question:
(A) Using $\epsilon$ and $\delta$, show that $f(x)$ is continuous at $2$.
(B) Is $f(x)$ continuous at $1$.
Attempt:
(A) Since $\mathbb{Q}$ is dense in $\mathbb{R}$, there exists a sequence ${(p_n)} \in \mathbb{Q}$ with ${(p_ n) \neq (p)}$ $\forall n\in\mathbb{N}$ such that ${(p_ n) \to (p)}$. Then $\lim_{x\to 2} f(x) = 16$. Also since $\mathbb{R}/ \mathbb{Q}$ is also dense in $\mathbb{R}$, there exists a sequence $(q_n)$ of irrational numbers with $(q_n) \to 16$. Since $\lim_{x\to \infty} f(q_n) = \lim_{x\to \infty} q_n=16$, therefore $\lim_{x\to 2} f(x)=16.$ Ok - I confess - I'm lost.
(B) Simply looking at an epsilon neighborhood of values of $f(x)$ near $1$ tells me no.
 A: (A) We take $x_0=2$, $\varepsilon>0$, arbitrary $x$, $|x-x_0|<\delta$ (we'll find this delta later). We need only consider the case when $x$ doesn't belong to $\mathbb{Q}$ (other case is evident). We write: $|f(x)-f(x_0)|=|f(x)-16|=|8x-16|=8|x-2|<8\delta$ and then require it to be less than epsilon: $8\delta < \varepsilon$ - and here we've obtained constraint for delta from the definition of continuity. That is, by epsilon we've found appropriate delta. Hence, $f(x)$ is continuous in $2$.
(B) I'll only write down the case where $x$ tends to $1$ from the left. Consider two sequences: $x_n=\sqrt{\frac{n-1}{n}},\ y_n=\frac{n-1}{n}$. Then, $f(x_n)$ tends to $10$, while $f(y_n)$ tends to $8$. So, $f(x)$ couldn't be continuous in $1$.
A: Other than $\epsilon,\delta$ you can do like this
Let $c\in\mathbb{R}$  be any point then if $f$ is continuous at $c$ iff any sequence $x_n\to c\Rightarrow f(x_n)\to f(c)$
if $x_n\in\mathbb{Q}\ni x_n\to c$ then $f(x_n)=\{2x_n^2+8\}$ and if $x_n\in\mathbb{Q}^c\ni x_n\to c$ then $f(x_n)=\{8x_n\}$ but as $f$ is continuous at $c$ so both limit must be same i.e $\lim(2x_n^2+8)=\lim 8x_n\Rightarrow 2c^2+8=8c\Rightarrow c=2$
