Proof of continuity - (ε-δ) definition - Can anyone check this?

I've been trying to get my head around this problem for quite some time by now. I want to prove that $$f(x) := \left|\frac{x-1}{x^2+1}\right|$$ is continuous for $$x_0 = -1$$

Now, in order to prove this, I want to use to ε-δ defintion which states that for any given $\varepsilon$, there exists $\delta>0$ such that

$$\left|x-x_0\right| < \delta \Rightarrow \left|f(x)-f(x_0)\right|<\varepsilon$$

I'm fairly new to the concepts of analysis; but I understand that in order to conduct these sorts of proofs, you first need to spend a few minutes to find out a reasonable value for $\delta$. Unfortunately, I can't find any particular "rules" on how to do that. So, I first tried to fill in some gaps for my particular problem:

Given $\varepsilon > 0$, we can find $\delta > 0$ such that, if $\left|x-(-1)\right| = \left|x+1\right| < \delta$, then $$\left|\frac{x-1}{x^2+1}-(-1)\right|=\left|\frac{x-1}{x^2+1}+1\right|=\left|\frac{x²+x}{x^2+1}\right|<\varepsilon$$

My plan is now to take care of the implication first. That is, I want to paraphrase $\left|\frac{x²+x}{x^2+1}\right|<\varepsilon$ in a way that makes sure that the actual $\varepsilon > 0$ chosen does not matter at all. So, in the end, I think manipulating $\left|\frac{x²+x}{x^2+1}\right|<\varepsilon$ to look like $\left|x+1\right| < ε \cdot \varphi$ would be my goal, right? Because then, if we let $\delta := \varepsilon \cdot \varphi$, the implication holds.

I hope everything to this point was correct. Now, I find

$$\left|\frac{x²+x}{x^2+1}\right| = \left|\frac{x(x^2+1)}{x+1}\right| = \left|x+1\right|\left|\frac{x}{x^2+1}\right|<\varepsilon$$ which is why I would want to let $\delta := \frac{\varepsilon}{\left|\frac{x}{x^2+1}\right|}$ (which looks quite ugly, point taken).

Is my choice of $\delta$ okay? I never saw a $\delta$ contain $x$ as a variable before, my professor always somehow managed to set $\delta$ to $\varepsilon$ times some constant $\varphi$, but I can't seem to do it.

Can anyone check my current steps and help me find a constant $\varphi$, if this is necessary for the proof I'm building up?

-
Delta cannot involve $x$. Remember that $\delta$ defines the range of $x$-values being considered, so it doesn't make sense for it to have $x$ in it. –  NotNotLogical May 12 at 23:58

Note that

$$\left|\frac{x}{x^2+1}\right|<1, \forall x \in \mathbb{R}.$$ So, taking $\epsilon=\delta$ you have

$$|x+1|<\delta \Rightarrow \left|\frac{x^2+x}{x^2+1}\right| = \left|\frac{x(x+1)}{x^2+1}\right| = \left|x+1\right|\left|\frac{x}{x^2+1}\right|<|x+1|<\delta=\epsilon.$$

-
Wonderful, I didn't even see that :) Small correction: It should be $\left|\frac{x(x+1)}{x+1}\right|$ in the middle. –  chiru May 13 at 0:09
This solution is clever, but the one by @Omnomnomnom is much better for understanding how to do this type of problem in general. Setting delta equal to the minimum of a constant and some function of epsilon (in this case, $\delta = min\{1, \epsilon/2\}$) is a standard approach for these types of problems –  ahuff44 May 13 at 0:12

You don't need the best $\delta$, you just need a $\delta$ that works.

In particular, when $|x+1| < \delta$, we need to have $$\left|x+1\right|\left|\frac{x}{x^2+1}\right|<\varepsilon$$ Or in other words, we need to have $$\delta \left|\frac{x}{x^2+1}\right|<\varepsilon$$ But let's presuppose that we're going to set $\delta < 1$. If we already know that $|x + 1| < 1$, then we know $-2 < x < 0$. So, we can say that $$\left|\frac{x}{x^2+1}\right| = \frac{|x|}{|x^2 + 1|} < \frac{2}{x^2+1} < \frac{2}{0^2+1} = 2$$ So, presupposing $\delta < 1$, it's enough to have $$\delta \cdot 2 < \varepsilon$$ So, one satisfactory choice of $\delta$ will be $\delta = \min\{1,\epsilon/2\}$.

-