How can I prove that a limit of a function exists if and only if both limit sides exist and are equal? I understand the concept behind this and it is quite obvious to me as to why but I am having problems proving this rigorously. To make things more "simple," imagine that there is function $f: [-2,2] \rightarrow \mathbb{R}$ and I must prove that $\lim_{x\rightarrow0}{f(x)}=L$ is true if and only if $\lim_{x\rightarrow0^+}{f(x)}=L$ and $\lim_{x\rightarrow0^-}{f(x)}=L$. Here is my attempt:
Using the definition, let there be set $[-2,2] \subseteq \mathbb{R}$ and $0$ be a cluster point of $[-2,2] \cap (0,\infty)$. Then let $f:[-2,2] \rightarrow \mathbb{R}$. Thus, $\lim_{x\rightarrow0^+}{f(x)}=L$ if for all $\epsilon > 0$, there is $\delta > 0$ such that for all $x \in [-2,2], 0 < x < 0 + \delta$, we have $|f(x)-L| < \epsilon$. In addition, $\lim_{x\rightarrow0^-}{f(x)}=L$ if for all $\epsilon > 0$, there is $\delta > 0$ such that for all $x \in [-2,2], 0 - \delta < x < 0$, we have $|f(x)-L| < \epsilon$. Then, since $-\delta < x < \delta$ and $|f(x)-L| < \epsilon$, we get that $\lim_{x\rightarrow0}{f(x)}=L$.
But I am not sure how to start the converse of this to finish the proof.
 A: Assume that $\lim_{x\to 0} f(x)$ exists and equals $L$.
Then, for all $\epsilon > 0$ there exists $\delta > 0$ such that
$0 < |x| < \delta \implies |f(x) - L| < \epsilon.$
Note that $0 < x < \delta \implies 0 < |x| < \delta.$
Similarly, $-\delta < x < 0 \implies 0  < |x| < \delta.$
Therefore, for the specific $\epsilon, \delta$ combination, you have that
$$0 < x < \delta \implies |f(x) - L| < \epsilon \tag1$$
and
$$-\delta < x < 0 \implies |f(x) - L| < \epsilon. \tag2 $$
Therefore, for any $\epsilon$, there exists a $\delta$ such that the implications in (1) and (2) above both hold.
This is a direct consequence of the presumption that
$$\lim_{x\to 0} f(x) = L. \tag3 $$
Therefore, (3) above implies that

*

*$\lim_{x\to 0^+} f(x) = L. $


*$\lim_{x\to 0^-} f(x) = L. $

Addendum
I think that your proof of the other direction of the problem is fine.  However, for what it's worth, I would have chosen an approach very similar to the approach that I took in the first part of my answer.
Namely, suppose that

*

*$\lim_{x \to 0^+} f(x)$ exists and equals $L$.

*$\lim_{x \to 0^-} f(x)$ exists and equals $L$.

Then, for any $\epsilon > 0$ there exists $\delta_1, \delta_2$ such that:

*

*$0 < x < \delta_1 \implies |f(x) - L| < \epsilon.$


*$-\delta_2 < x < 0 \implies |f(x) - L| < \epsilon.$
Take $\delta = \min(\delta_1, \delta_2)$.
Then $0 < |x| < \delta$ implies that one of the following must be true:
Either $0 < x < \delta$ or $-\delta < x < 0$.
Therefore, in either event, you will have the implication that $|f(x) - L| < \epsilon.$
Therefore, by virtue of the twin assumptions that

*

*$\lim_{x \to 0^+} f(x)$ exists and equals $L$ and

*$\lim_{x \to 0^-} f(x)$ exists and equals $L$
you have that for any $\epsilon$, there exists a corresponding $\delta_1, \delta_2$, so that $\delta = \min(\delta_1, \delta_2)$ may be set.
This means that for any $\epsilon > 0$ there exists $\delta > 0$ such that the desired implication holds.
Therefore, the presumption that

*

*$\lim_{x \to 0^+} f(x)$ exists and equals $L$ and

*$\lim_{x \to 0^-} f(x)$ exists and equals $L$
implies that

*

*$\lim_{x \to 0} f(x)$ exists and equals $L$.

