One criterion for checking existence of limits is to check that and one-sided limits from left and right exist and agree:
(Theorem) Let $f$ be a real-valued function. One-sided limits of $f$ as $x$ approaches $a$ from the left and right exist and equal $L$: $$ \lim_{x \to a^-} f(x) = \lim_{x \to a^+} f(x) = L $$ if and only if the two-sided limit of $f$ at $a$ exists and also equals $L$, $$\lim_{x \to a} f(x) = L.$$
The contrapositive of this statement can be used to conclude that a limit does not exist:
(Contrapositive) Let $f$ be a real-valued function. One-sided limits of $f$ as $x$ approaches $a$ from the left and right do not exist or do not agree if and only if the limit of $f$ at $a$ does not exist.
When applying this to a variety of contexts, you can come up with some pretty weird examples and weird results.
In the above figure, it seems to me that
- $\lim_{x \to 3} f(x)$ does not exist since $\lim_{x \to 3^+} f(x)$ does not exist.
- $\lim_{x \to 4} f(x)$ does not exist since $\lim_{x \to 4^-} f(x)$ and $\lim_{x \to 4^-} f(x)$ do not exist.
- $\lim_{x \to 5} f(x)$ does not exist since $\lim_{x \to 5^-} f(x)$ does not exist.
A bit more controversial is if you apply the same to the limits at infinity, which would stand to reason that
- $\lim_{x \to \infty} f(x)$ does not exist since $\lim_{x \to \infty^+} f(x)$ does not exist.
- $\lim_{x \to -\infty} f(x)$ does not exist since $\lim_{x \to \infty^-} f(x)$ does not exist.
However to contradict the above, many people would write $\lim_{x \to \infty} f(x)=2$ and $\lim_{x \to -\infty} f(x)=-1$.
TLDR; why does the nonexistence of left and right limits not cause limits at infinity to be undefined but does cause the limit at $x=3$, $x=4$, and $x=5$ to not exist? Real analysis answers are welcome.
Edit Thanks to answers from Troposphere and Joe, I worked out some more careful definitions and theorems:
Definition (Limit) Let $f$ be a function whose domain is a subset of $\mathbb{R}$, and let $a, L \in \mathbb{R}$. We say that the limit of $f$ as $x$ approaches $a$ is $L$, \begin{equation*} \lim_{x \to a} f(x)=L \end{equation*} to mean that $a$ is an accumulation point of $\textrm{dom}(f)$ and for any $\epsilon > 0$, there exists $\delta >0$ such that if $x \in \textrm{dom}(f)$ is within $\delta$ of $a$ (with $x \ne a$), then $f(x)$ is within $\epsilon$ of $L$: \begin{equation*} 0 < |x-a| < \delta \quad \rightarrow \quad 0 < |f(x)-L| < \epsilon. \end{equation*}
Definition (One-Sided Limits) Let $f$ be a function whose domain is a subset of $\mathbb{R}$, and let $a, L \in \mathbb{R}$.:
We say the limit of $f$ as $x$ approaches $a$ from the left is $L$, $$\lim_{x \to a^-} f(x)=L,$$ to mean that $a$ is an accumulation point of $\textrm{dom}(f) \cap (-\infty,a]$ and for any $\epsilon > 0$, there exists $\delta >0$ such that if $x$ is within $\delta$ of $a$ (for $x < a$), then $f(x)$ is within $\epsilon$ of $L$: \begin{equation*} 0 < a-x < \delta \quad \rightarrow \quad 0 < |f(x)-L| < \epsilon. \end{equation*}
We say the limit of $f$ as $x$ approaches $a$ from the right is $L$, \begin{equation*} \lim_{x \to a^+} f(x)=L, \end{equation*} to mean that $a$ is an accumulation point of $\textrm{dom}(f) \cap [a,\infty)$ and for any $\epsilon > 0$, there exists $\delta >0$ such that if $x$ is within $\delta$ of $a$ (for $x > a$), then $f(x)$ is within $\epsilon$ of $L$: \begin{equation*} 0 < x-a < \delta \quad \rightarrow \quad 0 < |f(x)-L| < \epsilon. \end{equation*}
Theorem (One-Sided and Two-Sided Limits Relationship) Let $f$ be a function whose domain is a subset of $\mathbb{R}$, and let $a, L \in \mathbb{R}$. Suppose
a is an accumulation point of dom(f) andthat $f$ is defined everywhere in some punctured neighborhood of $a$. ThenOne sided limits of $f$ from left and right at $a$ exist and equal $L$, $$\lim_{x \to a^-} f(x) = L \textrm{ and }\lim_{x \to a^+} f(x) = L,$$
if and only if the two-sided limit of $f$ at $a$ exists and also equals $L$: $$\lim_{x \to a} f(x) = L.$$
Contrapositive (One-Sided and Two-Sided Limits Relationship) Let $f$ be a function whose domain is a subset of $\mathbb{R}$, and let $a, L \in \mathbb{R}$. Suppose
a is an accumulation point of dom(f) andthat $f$ is defined everywhere in some punctured neighborhood of $a$. ThenAt least one of the one sided limits of $f$ from left and right at $a$ does not exist or do not equal $L$: $$\lim_{x \to a^-} f(x) \ne L \textrm{ or }\lim_{x \to a^+} f(x) \ne L,$$
if and only if the two-sided limit of $f$ at $a$ does not exist or does not equal $L$: $$\lim_{x \to a} f(x) \ne L.$$
Under these definitions and theorems, I think (hope) we get the conclusions we expect:
- $\lim_{x \to 3} f(x)$ exists
- $\lim_{x \to 5} f(x)$ exists.
and
- $\lim_{x \to 3^+} f(x)$ DNE.
- $\lim_{x \to 4} f(x)$ DNE.
- $\lim_{x \to 5^-} f(x)$ DNE.