For limx→af(x) to exist and equal L, we
need f(x) to be approximately L on both
sides of x=a.
limx→af(x)=L⟺limx→a−f(x)=L and limx→a+f(x)=L.
If the two one-sided limits are different, or if one (or both) of
them fail to exist, then the overall limit doesn't exist.
Note that the value of
f(a) doesn't enter into this, and it doesn't matter whether
f(a) is defined or not defined. Recall that when evaluating a
limit of f as x→a we only care about what happens when x
is near a (when x is slightly less than a, or slightly
greater than a), not what happens when x is equal to a.