Here we make use of a well-known and important inequality for the cosine function: namely, that
\begin{equation*}
-1\leq \cos t\leq 1
\end{equation*}
for all \(t\in \R\text{.}\) It follows that
\begin{equation}
-1\leq \cos(1/x)\leq 1\tag{3.2}
\end{equation}
for all
\(x\ne 0\text{.}\) Since
\(x^2\geq 0\) for all
\(x\text{,}\) the inequalities in
(3.2) still hold after multiplying each expression by
\(x^2\text{:}\) that is
\begin{equation*}
-x^2\leq x^2\cos(1/x)\leq x^2
\end{equation*}
for all \(x\ne 0\text{.}\) Thus, letting \(g(x)=-x^2\) and \(h(x)=x^2\text{,}\) we have
\begin{equation}
g(x)\leq f(x)\leq h(x)\tag{3.3}
\end{equation}
for all \(x\ne 0\) in the open inteval \(\R=(-\infty,\infty)\text{.}\) Lastly, we compute
\begin{align*}
\lim_{x\to 0}g(x) \amp = -0^2 \amp \text{(poly. eval.)}\\
\amp = 0\\
\lim_{x\to 0}h(x) \amp = 0^2 \amp \text{(poly. eval.)}\\
\amp = 0\text{.}
\end{align*}
Since
(3.3) holds for all
\(x\ne 0\) in
\(\R\text{,}\) and since
\begin{equation*}
\lim_{x\to 0}g(x)=\lim_{x\to 0}h(x)=0\text{,}
\end{equation*}
we conclude using the sandwich theorem that \(\lim\limits_{x\to 0}f(x)=0\text{.}\)