Check the continuity of a function 
Given 
  $$f(x) = 
\begin{cases}
0, & x \in [-2,2]\\
x-2, & x > 2\\
x+2, & x < -2,
\end{cases}
$$
  check whether $f$ is continous on $\mathbb{R}$.

I used one-side limits in order to check the continuity at $x=-2$ and $x=2$, as there is no need to check the continuity at other points.
Therefore, $\lim_{x\to 2^-}f(x) = 0$ and $$\lim_{x\to 2^+}f(x) = \lim_{x\to 2^+} (x - 2) = 2 - 2 =0.$$
 Limits exist, they are defined and equal to each other, hence $f$ is continuous on $\mathbb{R}$.
 A: Examining a 'toned down' scenario can be used to put together a complete logical argument to address the OP's question.
Let $\alpha \lt 0 \lt \beta$ and $a, b \in \mathbb R$.
Consider a function $f: (\alpha, \beta) \to \mathbb R$ defined by
$$f(x) = 
\begin{cases}
ax, & x \in (\alpha,0)\\
0, & x = 0\\
bx, & x \in (0,\beta)
\end{cases}
$$
Then $f$ is continuous at $x = 0$.
If both $a$ and $b$ are zero then is $f$ is a constant function and therefore continuous at $x =0$.
Otherwise let $\varepsilon \gt 0$. Construct 
$$\tag 1 \delta = min(-\alpha, \beta, \frac{\varepsilon}{max(|a|, |b|)})$$
Then if $|x - 0| \lt \delta$ we know that that $x$ is in the domain of $f$ and also that 
$$\tag 2 |x| \lt \frac{\varepsilon}{max(|a|.|b|)}$$
But then
$$\tag 3 |f(x) - f(0)| = |f(x)| < |x| \; max(|a|,|b|) \lt \varepsilon$$
A: If you performed a similar (expanded) deduction to prove that $\,\lim_{x\to 2^-}f(x) = 0$ as you did for $x\to 2^+$, you are right.

A: Let $g: \mathbb R \rightarrow \mathbb R$ and $\ h: \mathbb R \rightarrow \mathbb R$ are functions
$$\color{red}{g(x) = \frac 1 2 \left|x-2 \right|-1},\quad \color{green}{h(x) = \frac 1 2|x+2 |-1}$$
Functions $\color{red}{g}, \color{green}{h}$ are contiguous on $\mathbb R$, so their sum $\color{blue}{g + h}$ is continuous on $\mathbb R$, too.

Your function $f$

is in the interval $[-2, \infty)$ identical with this sum $\color{blue}{g + h}$, so it is continuous in this interval.
Similarly, function $f$ is in the interval $(-\infty, 2]$ identical with a continuous function $-(\color{blue}{g + h})$, so it is continuous in this interval, too.
It means that function $f$, continuous in both intervals $(-\infty, 2]$ and $[-2, \infty)$, is continuous in whole $\mathbb R$.
