If a function is defined in pieces, and if the definition changes at
$x=a$, then we use the definition for $x \lt a$ to compute
$\displaystyle{\lim_{x \to a^-} f(x)}$, we use the definition at $x=a$ to
compute $f(a)$, and the definition for $x \gt a$ to compute
$\displaystyle{\lim_{x \to a^+} f(x)}$, and then we compare the three
quantities.
Example: If $f(x) = \begin{cases} 1-x & x< 0, \cr x^2 & x \ge 0,
\end{cases} \qquad $
then
\begin{eqnarray*}
\displaystyle{\lim_{x \to 0^-} f(x)} =& \displaystyle{\lim_{x \to 0^-} 1-x}
& = 1 \cr
\displaystyle{\lim_{x \to 0^+} f(x)} =& \displaystyle{\lim_{x \to 0^+} x^2}
& = 0 \cr
f(0) =& x^2 \Big |_{x=0}
& = 0.
\end{eqnarray*}
Since the limits from the left and right do not agree, there is no overall
limit, and the function is discontinuous at $x=0$.