prove some point is a continuous and not continuous Let's say we have a function 
$$f(x) =\begin{cases} 
8x & \text{ when } x \text{ is rational } \\  
2x^2 + 8 & \text{ when } x \text{ is  irrational } \end{cases}$$

Lets prove this with $\epsilon$, $\delta$, that $f$ is continuous at $2$.

I think $2$ is the rational number so it's  $8x = 8(2) = 16$, 
 and also every neighbour of this $16$ , $N_{\epsilon}(f(2))$ is also very closed with irrational number since  $2x^2 + 8 = 16$
so  $$N_{\epsilon}(f(2))<\delta$$
therefore $f(x) $ is continuous at $2$. Is this right approach? I'm not sure how to write proper way.

  
*
  
*second question: Is $f$ continuous at $1$?
  

I guess this is not continuous at $1$ because  neighborhood of $1$ values are far away with neighborhood of the $\epsilon$  $$N_{\epsilon}(f(2))>\delta$$
Fix my proof it there is something wrong and please make it a proper proof
 A: I generally think giving full solutions to homework problems is bad, but in this particular case, I think seeing what an $\epsilon$-$\delta$ proof looks like in practice is worthwhile.
Let $\epsilon > 0$. Let $\delta_1 = \epsilon/16$, and let $\delta_2 = \sqrt{\epsilon/4}$. Let $\delta = \min{\{\delta_1, \delta_2\}}$. Then, if $|x-2| < \delta$, there are two cases. 
If $x$ is rational, then $|f(x) - f(2)| = |8x - 16| < 8\delta \leq 8\delta_1 = \epsilon/2 < \epsilon$.
If $x$ is irrational, then $|f(x) - f(2)| = |2x^2 + 8 - 16| = |2x^2 - 8|$
$ = |2(x-2)^2 + 8x - 16| \leq |2(x-2)^2| + |8(x-2)|$ (triangle inequality)
$ < 2 \delta^2 + 8\delta \leq 2\delta_2^2 + 8\delta_1 = \epsilon/2 + \epsilon/2 = \epsilon$
Thus in both cases, if $|x - 2| < \delta$, $|f(x) - f(2)| < \epsilon$. Thus $f$ is continuous as $2$.
For discontinuity at 1: if $\eta > 0$ is irrational, then $f(\eta + 1) = 2(\eta + 1)^2 + 8 = 2\eta^2 + 4\eta + 9$. So $|f(\eta + 1) - f(1)| > 1$. So if $\delta > 0$ pick an irrational $\eta$ with $0 < \eta < \delta$; then $x = \eta + 1$ satisfies $|x - 1| < \delta$ but $|f(x) - f(1)| > 1$. So $f$ cannot be continuous at $1$.
