Cluster points
To start talking about limits of functions first we need to introduce the concept of cluster point.
Intuitively, $x$ is an cluster point of $S$ if there are points of $S$ arbitrarily close to $x.$ Notice also that a cluster point of $S$ does not need to lie in $S.$
Limits of functions
If a function $f$ is defined on a set $S$ and $c$ is an cluster point of $S,$ then we define the limit of $f(x)$ as $x$ gets close to $c.$ It is irrelevant for the definition whether $f$ is defined at $c$ or not. Even if the function is defined at $c,$ the limit of the function as $x$ goes to $c$ can be totally different from $f(c).$
Claim: $\displaystyle \lim_{x\ra 2} 3x+1 = 7.$
Discussion: For every $\vre >0 ,$ we need to find a $\delta>0$ so that \[ \abs{x-2}\lt\delta \quad \implies \quad \abs{(3x+1) - 7}\lt \vre. \] So we start from what we want to estimate: \[ \abs{(3x+1) - 7} = \abs{3x-6} = 3\abs{x-2}\lt 3 \delta \] If we choose $\delta := \vre/3,$ then $\abs{(3x+1) - 7} \lt \vre .$ Now we are ready to write a formal proof.
Proof. Let $\vre >0 .$ Put $\delta := \vre/3.$ Thus for all $x\in \R \setminus \{2\}$
Claim: $\displaystyle \lim_{x\ra 2} x^2 = 4.$
Discussion: Given an arbitrary $\vre >0 ,$ our goal is to find a $\delta>0$ so
that
\[
\abs{x-2} \lt \delta \quad \implies \quad \abs{x^2 - 4}\lt \vre.
\]
Note that
\begin{eqnarray}\label{eq:quadratic}
\abs{x^2 - 4} = \abs{x+2}\abs{x-2}
\end{eqnarray}
Here we can make $\abs{x-2}$ as small as we like, but we need an upper bound on $\abs{x+2}$ in
order
to know how small to choose $\delta.$ In this case, the presence of the factor $\abs{x+2}$ in
the
expression (\ref{eq:quadratic}) may cause some initial confusion, but keep in mind that we are
discussing the limit as $x$ approaches $2.$
So, we need to manipulate the inequality $\abs{x-2}\lt\delta$ in order to get an upper bound for
$\abs{x+2},$ that is
\begin{eqnarray*}
&\abs{x-2}& \lt \delta \\
-\delta \lt & x-2 & \lt \delta \\
4 -\delta \lt& x + 2 & \lt 4 + \delta\\
&\abs{x+2}& \lt \delta + 4
\end{eqnarray*}
If $\delta =1,$ then $\abs{x+2} \lt 1+ 4 = 5 .$
Thus, if we choose $\delta := \min\{1, \vre / 5\},$ $\abs{x-2}\lt\delta$ implies $\abs{x^2 - 4}
\lt
\vre .$ Now let's write the formal proof.
Let $\vre >0 .$ Choose $\delta := \min\{1, \vre / 5\}.$ For all $x\in \R \setminus \{2\}$ and $\abs{x-2}\lt \delta,$ we have that \[ \abs{x^2-4} \lt \abs{x+2}\abs{x-2} \lt (5) \frac{\vre}{5} \lt \vre \] and the limit is proved.
Why do we need cluster points? 🤔
At this point, it is likely you are asking yourself:
Why do we need the concept of cluster point in the definition of limit?
To answer this question suppose \(c\) is not a cluster point of \(S.\) Then there exists some \(r\) such that the interval \((c-r,c+r)\) contains no points in \(S\) other than \(c\) itself.
Then, for any function \(f,\) choose any number \(L.\) Let \(\varepsilon\gt0\) be arbitrary and choose \(\delta = r.\) Since there are no points \(x\in S\setminus\{c\}\) such that \(|x-c|\lt\delta=r,\) then the statement:
For every \(\varepsilon \gt 0\) there exists a \(\delta \gt 0\) such that if for every \(x\in S\setminus\{c\}\) and \(|x-c|\lt \delta,\) then \(|f(x)-L|\lt \varepsilon.\)
is vacuously true!