Given the function \(g\) (see the picture),
find \(\lim _{x\to 1}g(x)\).
\[
g(x)=\begin{cases}
-\frac12(x-1)^2+2 & \text{if } x < 1,\\
\frac2{x^2}+1 & \text{if } x \geq 1
\end{cases}
\]
Given the function \(g\) (see the picture),
find \(\lim _{x\to \infty }g(x)\).
\[
g(x)=\begin{cases}
-\frac12(x-1)^2+2 & \text{if } x < 1,\\
\frac2{x^2}+1 & \text{if } x \geq 1
\end{cases}
\]