Let $ f\colon \mathbb{R} \to \mathbb{R}$ be $$x \mapsto \begin{cases} \frac{(x-1)^2}{x^2+1}, &|x| \neq 1 \\2, &|x|=1\end{cases} $$
How can I show that $f$ is uniformly continuous on $[-2,2]\backslash \{ - 1,1\}$? I thought it could be done with the $ \epsilon - \delta$ criteria but I am not sure because of the specific interval.
$$f(x)= 1-\frac{2x}{x^2+1}$$ for $|x|\neq 1. $ $$|f'(x)| =\left|\frac{2(1+x^2) -2x\cdot 2x }{(1+x^2)^2}\right|=\frac{2|1-x^2|}{(1+x^2)^2}\leq\frac{2(1+x^2)}{(1+x^2)^2}\leq 2 $$ Hence $f$ is Lipschitz continuous and therefore uniform continuous for $|x|\neq 1.$