%MIT OpenCourseWare: https://ocw.mit.edu
%18.100A / 18.1001 Real Analysis, Fall 2020
%License: Creative Commons BY-NC-SA 
%For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.

\begin{theorem}
For all $c\in \RR$, $\lim_{x\to c} x^2 = c^2$.
\end{theorem}
\textbf{Proof}: Let $\{x_n\}$ be a sequence in $\RR\setminus \{c\}$ such that $x_n\to c$. Then, $x_n^2 \to c^2$ by a theorem shown in Lecture 8. Thus, 
\[
\lim_{x\to c}x^2 = c^2.
\]
\qed 

\begin{theorem}
We show that
\begin{enumerate}
    \item $\lim_{x\to 0} \sin(1/x)$ does not exist, and 
    \item $\lim_{x\to 0} x\sin(1/x) = 0$.
\end{enumerate}
\end{theorem}
\textbf{Proof}:
\begin{enumerate}
    \item Let $x_n = \frac{2}{(2n-1) \pi}$. Then, $x_n\neq 0$, and $x_n\to 0$. But, 
\[
\sin(1/x_n) = \sin \left(\frac{(2n-1)\pi}{2}\right) = (-1)^{n+1}
\]
for all $n.$ However, this sequence does not converge (i.e. the limit does not exist).
\item Suppose $x_n\neq 0$ and $x_n\to 0$. Then, 
\[
0\leq |x_n\sin(1/x_n)| = |x_n||\sin(1/x_n)|\leq |x_n|.
\]
By the Squeeze Theorem, $\lim_{n\to \infty} |x_n\sin(1/x_n)| = 0$. \qed 
\end{enumerate}
We can use the `sequential limit' characterization to prove analogs of previous theorems for limits of sequences.
\begin{theorem}
Let $S\subset \RR$, $c$ a cluster point of $S$, and $f,g:S\to \RR$. Suppose $\forall x\in S$, $f(x) \leq g(x)$ and $\lim_{x\to c} f(x)$ and $\lim_{x\to c} g(x)$ exist. Then, 
\[
\lim_{x\to c} f(x)\leq \lim_{x\to c} g(x).
\]
\end{theorem}%stopped 1230; started 139
\textbf{Proof}: Let $L_1 = \lim_{x\to c} f(x)$ and $L_2 = \lim_{x\to c} g(x)$. Let $\{x_n\}$ be a sequence in $S\setminus \{c\}$ such that $x_n\to c$. Then, $\forall n\in \NN$, $f(x_n) \leq g(x_n)$. Therefore, 
\begin{align*}
    L_1 = \lim_{n\to \infty} f(x_n) &\leq \lim_{n\to \infty} g(x_n) = L_2. 
\end{align*}
\qed 

Similarly, we have analogs of the Squeeze Theorem, limits of algebraic operations, and limits of absolute values. You may read the end of Section 3.1.3 \textbf{[L]} for this.

\begin{definition}
Let $S\subset \RR$ and suppose $c$ is a cluster point of $S\cap (-\infty, c)$. Then, we say $f(x)$ converges to $L$ as $x\to c^{-}$ if $\forall \epsilon>0$ $\exists \delta >0$ such that if $x\in S$ and $c-\delta < x< c$ then $|f(x) -L|<\epsilon$.
\end{definition}

\begin{notation}
This is denoted $L = \lim_{x\to c^-} f(x)$.
\end{notation}

\begin{definition}
Similarly, let $S\subset \RR$ and suppose $c$ is a cluster point of $S\cap (c,\infty)$. Then, we say $f(x)$ converges to $L$ as $x\to c^{+}$ if $\forall \epsilon>0$ $\exists \delta >0$ such that if $x\in S$ and $c < x< c+\delta$ then $|f(x) -L|<\epsilon$.
\end{definition}

\begin{notation}
This is denoted $L = \lim_{x\to c^+} f(x)$.
\end{notation}

\begin{example}
Let $f(x) = \begin{cases}1 & x>0 \\ 0 & x< 0\end{cases}$. Then, 
\[
\lim_{x\to 0^-} f(x) = 0 \hspace{.25cm} \text{and} \hspace{.25cm} \lim_{x\to 0^+} f(x) = 1,
\]
even though $f(0)$ is undefined.
\end{example}

\begin{theorem}
Let $S\subset \RR$ and let $c$ be a cluster point of $S\cap (-\infty, c)$ and $S\cap (c,\infty)$. Then, $c$ is a cluster point of $S$. Moreover, 
\[
\lim_{x\to c} f(x) = L \iff \lim_{x\to c^-}f(x) = \lim_{x\to c^+} f(x) = L.
\]
\end{theorem}

\noindent\underline{\textbf{Continuous Functions}}

As we have seen, limits do not care about $f(x)$ when $x = c$. Continuity is a condition that connects $\lim_{x\to c} f(x)$ with $f(c)$.

\begin{definition}[Continuous Functions]
Let $S\subset \RR$ and let $c\in S$. We say $f$ is \vocab{continuous at $c$} if $\forall \epsilon>0$ $\exists\delta>0$ such that if $x\in S$ and $|x-c|<\delta$ then $|f(x) - f(c)|< \epsilon$ We say $f$ is \vocab{continuous on U} for $U\subset S$ if $f$ is continuous at every point in $U$.
\end{definition}

\begin{example}
$f(x) = ax+b$ is continuous on $\RR$.
\end{example}
\textbf{Proof}: Let $\epsilon>0$ and choose $\delta = \frac{\epsilon}{1+|a|}$. If $|x-c|<\delta$, then
\begin{align*}
|f(x) -f(c)| &= |ax+b-(ac+b)| \\
&= |a||x-c| \\
&< |a|\delta \\
&= \frac{|a|}{1+|a|}\epsilon < \epsilon.
\end{align*}
\qed 

\begin{example}
Show that $f(x) = \begin{cases}1 & x\neq 0 \\ 2 & x=0\end{cases}$ is \textit{not} continuous at $c = 0$.
\end{example}

First we write the negation of the definition of continuity.

\begin{negation}[Not Continuous]
$f$ is \vocab{not continuous at $c$} if $\exists \epsilon_0$ such that for all $\delta>0$, $\exists x\in S$ such that $|x-c| < \delta$ and $|f(x) - f(c)| \geq \epsilon_0$.
\end{negation}
\begin{proof}
Choose $\epsilon_0 = 1$ and let $\delta>0$. Then, $x = \frac{\delta}{2}$ satisfies $|x-0| < \delta$ and \[|f(x) - f(0)| = |2-1| \geq 1 = \epsilon_0.\]
\end{proof}