# Prove that a function does not have a limit when $x\rightarrow 0$

Let $$f(x)=\left\{ \begin{array}{l l} x+2 & \quad ,x\in\mathbb{Q}\\ 6-x & \quad ,x\notin\mathbb{Q} \end{array} \right.$$ then $$\lim_{x \to 0}f(x)$$ does not exist.

By limit definition.

I see that I should choose $\varepsilon_0=1$ but I don't see how do I continue..

Thanks

I think the sequential definition of a limit will make this problem easier. Let $(a_n), (b_n)$ be sequences such that: $$a_n \in \mathbb{R}\setminus \mathbb{Q}, \quad b_n \in \mathbb{Q} \\ a_n \to 0, \quad b_n \to 0$$ Then $$\lim_{n \to \infty} f(a_n) =6$$ while $$\lim_{n \to \infty} f(b_n) =2$$
For any neighborhood of 0 we know that there are rational and irrational numbers in it(since both are dense in the reals) thus $f$ will oscilate between values close to 2 and 6 for sufficiently small $\epsilon$ hence the limit doesn't exist.