Having trouble showing a function is continuous: $x/(1+|x|)$

For what follows I will need this inequality:

$$||x| - |y|| \leq |x - y|$$

and now let $\delta$ be fixed. We will see that $|x - x_0| < \delta$ will make $|f(x) - f(x_0)|$ quite small and controllable, and then we will reverse-engineer the $\delta$ we would need for an arbitrary $\epsilon$:

Start just like you did, but then do this in the numerator:

$$x(1 + |x_0|) - x_0(1 + |x|) = x(1+|x_0|) - x_0(1 + |x_0|) + x_0(1 + |x_0|) - x_0(1 + |x|)$$

Now we rewrite the numerator:

$$x(1+|x_0|) - x_0(1 + |x_0|) + x_0(1 + |x_0|) - x_0(1 + |x|) = (x- x_0)(1 + |x_0|) + x_0(|x_0| - |x|)$$

and plug it in the fraction you had:

$$\frac{|(x- x_0)(1 + |x_0|) + x_0(|x_0| - |x|)|}{|(1 + |x|)(1 + |x_0|)|}$$

use the triangular inequality to split the numerator into

$$\frac{|(x- x_0)(1 + |x_0|) + x_0(|x_0| - |x|)|}{|(1 + |x|)(1 + |x_0|)|} \leq \frac{|(x- x_0)(1 + |x_0|)|}{|(1 + |x|)(1 + |x_0|)|} + \frac{|x_0(|x_0| - |x|)|}{|(1 + |x|)(1 + |x_0|)|}$$

Now, on the one hand,

$$\frac{|(x- x_0)(1 + |x_0|)|}{|(1 + |x|)(1 + |x_0|)|} = \frac{|(x- x_0)|}{|(1 + |x|)|} \leq \delta$$

and on the other hand,

$$ \frac{|x_0(|x_0| - |x|)|}{|(1 + |x|)(1 + |x_0|)|} \leq \frac{|(|x_0| - |x|)|}{|(1 + |x|)|} \leq \frac{|x_0 - x|}{|(1 + |x|)|} \leq \delta$$

Thus $|x - x_0| < \delta \implies |f(x) - f(x_0)| < 2\delta$.

This means that, given an $\epsilon$, just take $\delta = \epsilon/2$.


One way to simplify the problem is to note that $f$ is an odd function, so without loss of generality, you can assume that $x_0\in (0,\infty).$ Of course this means that $|z|=z$ for $z\in (0,\infty).$ Therefore, we have

$|f(x) - f(x_0)| = |\frac{x}{1+|x|} - \frac{x_0}{1+|x_0|}| = |\frac{x(1+|x_0|) - x_0(1+|x|) }{(1+|x|)(1+|x_0|)}|=|\frac{x-x_0 }{(1+|x|)(1+|x_0|)}|\le \frac{|x-x_0|}{2},$ and this implies that we may take $\delta <\min (d(x_0,0),2\epsilon)=\min (x_0,2\epsilon).$

Note: if you do not want to use the fact that $f$ is odd, you can simply repeat the above calculation for $x_0\in (-\infty,0).$ The only change you will make is that $|z|=-z$ and this will give you the estimate $\delta<\min (|x_0|,2\epsilon).$

This leaves the proof of continuity at $x_0=0.$ In this case, you have

$|f(x) - f(0)| = |\frac{x}{1+|x|}|\le |x|$ and you can take $\delta<\epsilon.$


For any $\epsilon>0\ $ and any $x_0\in \mathbb{R}$ take $$\delta = \begin{cases} \epsilon;\ x_0=0\\ \min\{\epsilon,|x_0|\};\ x_0\not =0\\ \end{cases}$$ For this choice of $\delta$, If $x_0\not =0 $ and $|x-x_0|<\delta $ then $x,x_0$ has the same sign so $|x|x_0=x|x_0|$ and you can show that $$|f(x)-f(x_0)|\leq |x-x_0|\leq\epsilon$$ and you are done.