# Continuity proving of function with delta-epsilon

Prove continuity of function with the delta-epsilon definition in point $x_o=0$ $$f:\mathbb{R}\rightarrow \mathbb{R}$$ $$f(x) = \begin{cases} x^2+1, & x \in \mathbb{Q} \\[2ex] 2^x, & x \in \mathbb{R}-\mathbb{Q} \end{cases}$$

What I've done: I know that I know that in order to do so I must find that for any $\epsilon >0$, there exists a $\delta >0$ so that for any $x\in \mathbb{R}$ with $\left|x-x_o\right|<\delta$ we have $\left|f\left(x\right)-f\left(x_o\right)\right|<\epsilon \:$

We can see right off the bat that $f(x_o)=1$ So I must prove that $\left|x\right|<\delta$ implies $\left|f\left(x\right)-1\right|<\epsilon$

For when $x \in \mathbb{Q}$ I must prove that $\left|x\right|<\delta$ implies $\:\left|x^2\right|<\epsilon$, so I can just choose $\delta =\:\sqrt{\epsilon }$.

For the other case when $x \in \mathbb{R}-\mathbb{Q}$ I must prove that $\left|x\right|<\delta$ implies $\left|2^x-1\right|<\epsilon$ I know that $\left|2^x-1\right|\le \left|2^x\right|+1\le 2^{\left|x\right|}+1<2^{\delta }+1$ which would imply that $\delta =\:\frac{ln\left(\epsilon -1\right)}{ln\:2}$

So in the end I can just choose $\delta =\:min\left\{\frac{ln\left(\epsilon -1\right)}{ln\:2},\sqrt{\epsilon }\right\}$ and be done with it?

I'm a little bit unsure of these exercises, since I don't really have many examples to go by. Did I get something wrong here?

• What if I had $f\left(x\right)=ln\left(x+1\right)$ for one of the cases? How could I write that in relation to my $\delta$ or $\epsilon$ ? – MikhaelM Feb 5 '16 at 14:15
• But $ln(0+1)=0$ so $f$ would not be continuous for sure... – Max Feb 5 '16 at 15:44