Let $\epsilon>0$ be given. We have to find a number $\delta>0$ such that $\left|\frac{x^2-5x}{x^2+2}+1\right|<\epsilon$ whenever $|x-2|<\delta$. But, as Andre notes,
$$
\left|\frac{x^2-5x}{x^2+2}+1\right|=\left|\frac{2x^2-5x+2}{x^2+2}\right|=|x-2|\left|\frac{2x-1}{x^2+1}\right|.
$$
We find a positive constant $C$ such that $\left|\frac{2x-1}{x^2+1}\right|<C\Rightarrow |x-2|\left|\frac{2x-1}{x^2+1}\right|<C|x-2|$, and we can make $C|x-2|<\epsilon$ by taking $|x-2|<\frac{\epsilon}{C}=\delta$. We restrict $x$ to lie in the interval $|x-2|<1$ and note the following:
\begin{align}
|x-2|<1&\implies 1<x<3\\[1em]
&\implies 1>\frac{1}{x}>\frac{1}{3}\\[1em]
&\implies 1>\frac{1}{x^2}>\frac{1}{9}\\[1em]
&\implies \frac{1}{3}>\frac{1}{x^2+2}>\frac{1}{11}\\[1em]
&\implies \frac{5}{3}>\frac{2x-1}{x^2+2}>\frac{1}{11}\\[1em]
&\implies C=\frac{5}{3}.
\end{align}
Thus, we should choose $\delta=\min\left\{1,\frac{3\epsilon}{5}\right\}$. To see that this choice of $\delta$ works, consider the following:
Given $\epsilon>0$, we let $\delta=\min\left\{1,\frac{3\epsilon}{5}\right\}$. If $|x-2|<1$, then $\left|\frac{2x-1}{x^2+2}\right|<\frac{5}{3}$. Also, $|x-2|<\frac{3\epsilon}{5}$. Hence,
$$
\left|\frac{x^2-5x}{x^2+2}+1\right|=|x-2|\left|\frac{2x-1}{x^2+1}\right|<\frac{3\epsilon}{5}\cdot\frac{5}{3}=\epsilon,
$$
as desired. $\blacksquare$
$\epsilon$-$\delta$
construction. Also, you can use\left
and\right
to get properly sized delimiters (you can get even "more properly sized" delimiters using\biggl
and stuff like that but I often just go with\left
and\right
because I am lazy. $\endgroup$