# Can this function be defined in a way to make it continuous at $x=0$?

We have $$f=\frac{x}{\vert x-1 \vert - \vert x +1 \vert}$$

If we want to "define" this function to be continuous at $$x=0$$, it's limit at $$0$$ must equal $$f(0)$$. So we should find this limit and assign it to be equal to $$f(0)$$, then the function is continuous at $$0$$. Since we are looking at the function when $$x\to 0$$, $$x\neq 0$$. Lets divide both sides by $$x$$.

$$f=\frac{x}{\vert x-1 \vert - \vert x +1 \vert}=\frac{1}{\frac{\vert x-1 \vert}{x}-\frac{\vert x+1\vert}{x}}=\frac{1}{\vert 1-\frac{1}{x}\vert - \vert 1+ \frac{1}{x}\vert }$$

We can use $$\lim \phi(x)^{-1}=\frac{1}{\lim \phi(x)}$$ here ( the limit $$\neq$$ 0, by hypothesis ). The inverse of the limit of $$\phi(x)=\vert 1 - \frac{1}{x} \vert-\vert 1+\frac{1}{x}\vert$$, when $$x\to 0$$. If $$x<1$$, we have that $$\frac{1}{x}>1\implies0>1-\frac{1}{x}\implies \Bigg\vert 1-\frac{1}{x}\Bigg\vert=-\Big(1-\frac{1}{x}\Big)$$

Now if $$x>0$$, we have that $$\Bigg\vert 1 - \frac{1}{x} \Bigg\vert-\Bigg\vert 1+\frac{1}{x}\Bigg\vert=-2$$

and if $$x<0$$, then $$\Bigg\vert 1 - \frac{1}{x} \Bigg\vert-\Bigg\vert 1+\frac{1}{x}\Bigg\vert=1-\frac{1}{x}-1-\frac{1}{x}=\frac{(-2)}{x}$$

The limit of $$f$$ when $$x\to 0$$ appears to be $$\frac{-1}{2}$$. Could anyone tell me what errors I made in the limit finding process?

There is an error at the end of your calculations. In the case $$-1 < x < 0$$ we have $$\left\vert 1 - \frac{1}{x} \right\vert-\left\vert 1+\frac{1}{x}\right\vert= \left(1-\frac{1}{x}\right)+\left(1+\frac{1}{x}\right)=2$$ because the argument of the first absolute value is positive, and the argument of the second absolute value is negative.

A slightly simpler approach:

Since you are interested in the limit at $$x=0$$ it suffices to consider $$x = (-1, 1)$$, $$x\ne 0$$. For these arguments is $$x-1 <0$$ and $$x+1> 0$$, and therefore $$f(x)=\frac{x}{\vert x-1 \vert - \vert x +1 \vert} = \frac{x}{-(x-1) - ( x +1)} = \frac{x}{-2x} =-\frac 12$$ so that $$\lim_{x \to 0 }f(x) = -\frac 12 \, .$$

You get the correct result but the derivation is incorrect (or perhaps just unclear to me). You are performing the correct calculation for the $$x>0$$ case, but the $$x<0$$ should be more precise.

The second line should be:

$$$$\frac{1}{\frac{\left|x-1 \right|}{x} - \frac{\left|x+1 \right|}{x} } = \frac{sgn(x)}{\frac{\left|x-1 \right|}{|x|} - \frac{\left|x+1 \right|}{|x|} } = \frac{sgn(x)}{\left| 1 -\frac{1}{x} \right| - \left| 1 +\frac{1}{x} \right|},$$$$

where $$sgn(x)$$ is the sign function, which is $$1$$, when $$x>0$$, and $$-1$$, when $$x<0$$.

When $$x<0$$ and close to zero $$\left(1 + \frac{1}{x}\right)<0$$. Hence $$$$\left|1+ \frac{1}{x}\right| =- \left(1+ \frac{1}{x} \right).$$$$

Thus in the case of $$lim_{x\rightarrow0^-} f(x)$$ we have $$$$lim_{x\rightarrow0^-} \frac{sgn(x)}{\left|1 - \frac{1}{x} \right| - \left| 1 + \frac{1}{x} \right|}=lim_{x\rightarrow0^-} \frac{-1}{\left( 1 - \frac{1}{x} \right) + \left( 1 + \frac{1}{x} \right)} = -\frac{1}{2}.$$$$

So the limits on both sides match, hence the function is continuous. You have missed two minus signs. One from the $$sgn(x)$$ at first, and another one when computing $$\left| 1+ \frac{1}{x} \right|$$ so your result ends up correct but only because you got lucky in getting an even number of minus signs wrong.

As a final comment, I will say that in order to see that $$\left(1+ \frac{1}{x} \right)<0$$ for small negative x, we can observe that $$\lim_{x\rightarrow 0^-}\frac{1}{x} \rightarrow - \infty$$.

Another way could be:

Multiply by $$\frac{|x-1|+|x+1|}{|x-1|+|x+1|}$$, in this way you have at the denominator: $$(|x-1|-|x+1|)(|x-1|+|x+1|)=(x-1)^2-(x+1)^2=-4x$$ and at the nominator: $$x(|x-1|+|x+1|)$$ you can simplify the $$x$$ and it remains: $$\frac{|x-1|+|x+1|}{-4}$$ and the limit for the numerator is $$2$$.