Prove left limit equals right limit

The question is to show

$\mathop {\lim }\limits_{x \to x_0^{\rm{ + }}} f(x) = \mathop {\lim }\limits_{x \to x_0^{\rm{ - }}} f(x)$ if and only if $\forall \epsilon>0 \exists \delta>0$ such that $\forall x_1\in(x_0-\delta,x_0)\forall x_2\in (x_0,x_0+\delta)$, $|f(x_1)-f(x_2)|<\epsilon$.

Sufficiency is quite easy to prove. Suppose $\mathop {\lim }\limits_{x \to x_0^{\rm{ + }}} f(x) = \mathop {\lim }\limits_{x \to x_0^{\rm{ - }}} f(x) = A$, then $\exists \delta>0$ such that both $|f(x_1)-A|<\frac{\epsilon}{2}$ and $|f(x_2)-A|<\frac{\epsilon}{2}$ hold for any $x_1\in(x_0-\delta,x_0)$ and any $x_2\in (x_0,x_0+\delta)$. By triangular inequality $|f(x_1)-f(x_2)|<\epsilon$ follows.

However, I have difficulty with the converse, i.e. suppose "$\forall \epsilon>0 \exists \delta>0$ such that $\forall x_1\in(x_0-\delta,x_0)\forall x_2\in (x_0,x_0+\delta)$, $|f(x_1)-f(x_2)|<\epsilon$" how do we derive "$\mathop {\lim }\limits_{x \to x_0^{\rm{ + }}} f(x) = \mathop {\lim }\limits_{x \to x_0^{\rm{ - }}} f(x)$"? Thank you!

• First deduce that the one-sided limits exist. Then you can quickly get a contradiction from the assumption that they aren't equal. Now, if say $\lim\limits_{x\to x_0^+} f(x)$ doesn't exist, what does that mean for the values of $f$ on $(x_0,x_0+\eta)$ for an arbitrary $\eta > 0$? – Daniel Fischer Aug 15 '15 at 14:23

It is easier to understand this sort of thing by using not limits but the generalization $\limsup$ and $\liminf$, because they are always defined if you use the extended real line (meaning include $\infty$ and $-\infty$ and disallow multiplying $0$ with an infinity or subtracting an infinity from itself). $\def\rr{\mathbb{R}}$

Given function $f : \rr \to \rr$ such that:

$\forall ε>0 \exists δ>0 \forall x_1\in(x_0-δ,x_0)\forall x_2\in (x_0,x_0+δ) ( |f(x_1)-f(x_2)|<ε )$

We have the following:

Given $ε > 0$:

Let $δ > 0$ such that $|f(x_1)-f(x_0+\frac{1}{2}δ)| < ε$ for any $x_1 \in (x_0-δ,x_0)$.

Then $f(x_0+\frac{1}{2}δ) - ε \le \liminf_{x \to x_0^-} f(x) \le \limsup_{x \to x_0^-} f(x) \le f(x_0+\frac{1}{2}δ) + ε$.

Therefore $\liminf_{x \to x_0^-} f(x) = \limsup_{x \to x_0^-} f(x)$ and hence $\lim_{x \to x_0^-} f(x)$ exists.

Similarly $\lim_{x \to x_0^+} f(x)$ exists and it should be easy to prove them equal.