Or you can have a "piecewise" function like
f(x)= 3x+ 1 if x< 2 and
f(x)= 2x- 2 if x> 2
Then [math]\lim_{x\to 2^-} f(x)= \lim_{x\to 2} 3x+ 1= 3(2)+ 1= 7[/math] since we only look at x less than 2 and
[math]\lim_{x\to 2^+} f(x)= \lim_{x\to 2} 2x- 2= 2(2)- 2= 2[/math] since we only look at x greater than 2.
For a general function, g, the limit, [math]\lim_{x\to a} g(x)[/math] exists if and only if both [math]\lim_{x\to 2^-} g(x)[/math] and [math]\lim_{x\to a+} g(x)[/math] exist and are equal (and, of course, [math]\lim_{x\to a} g(x)[/math] is their common value).