# Counterexample to two-sided limit must equal one sided limits if they exist and are equal

We learned that the two sided limit must equal the one-sided limits if they both exist and are the same. And I don't seem to get it, because I think I found a counterexample (I hate when this happens!).

Consider $f(x) = (1 \text{ if } x=0)(0 \text{ otherwise})$. If we have a sequence $x_n$ with $x_n <0$ for all $n \in \mathbb{N}$ and $\lim_{n\to \infty} x_n= 0$, then we have $\lim_{n\to\infty} f(x_n) = 0$. Therefore $\lim_{x\to 0^-} f(x) = 0$. Likewise $\lim_{x\to 0^+} f(x) = 0$. Hence, it should be true that $\lim_{x\to 0} f(x) = 0$

But $(x_n) = (0,0,0,0,\ldots)$ is a sequence with $\lim_{n\to\infty} x_n= 0$ and $\lim_{n\to\infty}= f(x_n) = 1$. Therefore the limit does not exist!

• The limit is zero. So $\lim_{x \to 0}f(x)=0 \neq 1=f(0)$. – Jimmy R. Dec 7 '15 at 9:35
• My professor said that if a is in the domain of f, then the limit as x approaches a of $f(x)$ ist either undefined or $f(a)$... – Vincent Dec 7 '15 at 22:40
• No, I do not agree. The limit is zero. As in the answer below, as you approach $x=0$, $f(x)$ approaches zero. But it is not a matter of opinion. Either I am wrong or your lecturer means something else. Is $f$ continuous? No, because $f(0)=1\neq 0$, where $0=\lim_{x \to 0}f(x)$. Perhaps I am wrong... – Jimmy R. Dec 8 '15 at 13:28
• If you use sequences to define limits then you have to disallow sequences taking the value $a$. Moreover, what your professor said about $\lim_{x\to a}$ either being $f(x)$ or being undefined is not true. Your function is an example illustrating this. – Keenan Kidwell Dec 8 '15 at 13:56
• That's what I think, too! He literally wrote (my translation) ($f\colon D\to\mathbb{R}$ is the function, $a$ is the point that we check): "If $a\in D$ then the constant sequence $(a,a,a,\ldots)$ is possible, which means $\lim_{x\to a} f(x)$ is undefined or $f(a)$". So you back me up that this is wrong? – Vincent Dec 8 '15 at 15:24

You are not using the correct definition of (two-sided) limit. We say that $\lim_{x\to a}f(x)=b$ if for every $\epsilon>0$ there exists $\delta>0$ such that for all $x$ with $\color{red}{0<}|x|<\delta$ we have $|f(x)-b|<\epsilon$.
As you have observed, it may happen that there are sequences with $\lim_{n\to\infty}x_n=a$ and $\lim_{n\to\infty} f(x_n)\ne \lim_{x\to a}f(x)$.
• That's not really true; we defined limits using sequences during the lecture. The professor also said that if a is in the domain of f, then the limit as x approaches a of $f(x)$ ist either undefined or $f(a)$. – Vincent Dec 6 '15 at 23:09
If $$f(x)$$ is defined on an open interval containing $$c$$, then $$f(x)$$ is said to be continuous at $$c$$ if and only if $$\lim_{x \rightarrow c} f(x) = f(c)$$
In your case $$c=0$$ with $$f(0)=1$$ but $$\lim_{x \to 0 }f(x)=0$$. The limit of $$f(x)$$ refers to the behavior of $$f$$ as $$x$$ approaches the point. This has to do very much with the understanding of the notion of the limit, so your question is indeed very meaningful. As you "stand on $$f$$" and you approach $$x=0$$ then you will be approaching $$0$$. But exactly at $$0$$, $$f$$ makes a jump. This is not the limit, this is the value of $$f$$ at $$x=0$$.