not been on here in a while, but in this case I'm working on a blog article regarding an $\mathrm{isZero}$ function, which returns $1$ for true (the input is zero), and $0$ for false (the input is not zero). The function is based on taking advantage of the fact that:
$$\mathrm{isZero}(x) = 1 - \frac {x^2 + 1 - (|x + 1|) (|x - 1|)}{2}$$
I can programmatically test this for all values of $x$ (ADDENDUM: in the integer space), I've run all sorts of tests in Excel, JavaScript and other programming languages. I can prove it algebraically quite easily for $0$, just substitute $x = 0$ and everything reduces down perfectly to give me the $1$ that confirms the is-zero case.
However, (ADDENDUM: in the case of an integer x), where $x > 0$ or $x < 0$, when I pull graphs for $y = |x - 1|$ for $x > 0$ or $y = |x + 1|$ for $x < 0$, I find myself face to face with the inflection point where $x = 1$ for the former graph and where $x = -1$ for the latter graph, and I'm not sure how I could reduce down the $\mathrm{isZero}$ function equation based on whether I'm dealing with a positive non-zero value of $x$, or a negative non-zero value of $x$. I was wondering if anyone would know how I can prove in both cases that a non-zero value of $x$ yields a zero as a result of the above equation, thus satisfying the equation?
EDIT: I remembered that I was originally working with x being only in the integers space, thanks to 5xum. Apologies to all for having forgotten about this. I will update the main question accordingly with the necessary addenda.
To really analyze the value of your expression, first off, you can simplify the expression a bit to only have one absolute value. Since $|a||b|=|ab|$ and $(x+1)(x-1)=x^2-1$, you can simplify your expression into
$$1-\frac{x^2+1-|x^2-1|}{2}$$
Now, you you need to split cases, but not into $x<0$ and $x>0$! You need to split the cases into regions where the values under the absolute sign are always positive or negative!
In your case, $x^2-1$ is positive if $|x|>1$, and negative if $|x|<1$. So let's split cases.
In fact, your expression could most compactly be written as $\max\{0, 1-x^2\}$, or if you want the most explicit version, I would write it as
$$\begin{cases}1-x^2&\text{ if }-1\leq x\leq 1\\ 0&\text{ otherwise}\end{cases}.$$
Note, importantly, that so long as you evaluate the function on integer values, the function is indeed equal to $1$ for $x=0$, and it is also equal to $0$ for all other integers! This is because $0$ is the only integer that satisfies the equation $|x|<1$ and thus the only one that falls into the first case of the above analysis.