Consider the following binary operation on $\mathbb Z_{≥0}$: $f(a, b) = |a − b|$. Is $(\mathbb Z_{≥0}, f)$ a group? I'm trying to check the associativity (1), identity (2), and inverse (3).

*

*$||a-b|-|c||=||a|-|b-c||$;

*$|a-e|=|e-a|=|a|$;

*$|a||a^{-1}|=|a^{-1}||a|=e$.

Here are what I got for now but I don't feel that's a right proof.
 A: *

*Associativity:

We must verify that $\forall a$, $b$, $c \in \mathbb{Z}_{\geq 0}$, that:
$$f(f(a,b), c) = f(a, f(b, c))$$
To this end, we just lay out the expression:
$$f(f(a,b), c) = \lvert \lvert a - b\rvert - c\rvert = \lvert a - \lvert b - c \rvert\rvert = f(a, f(b,c))$$
Can you prove (or disprove) this?
(Answer if you get stuck:)
We give a particular counterexample. Assume that $a > b > c > 0$ so that $\lvert a - b\rvert = a - b$ and $\lvert b - c\rvert = b - c$. Then we have that:
$$f(f(a,b), c) = \lvert \lvert a - b\rvert - c \rvert = \lvert (a - b) - c\rvert$$
$$f(a, f(b,c)) = \lvert a - \lvert b - c\rvert \rvert = \lvert a - (b - c) \rvert$$
So associativity of $f$ in this case boils down to saying:
$$\lvert (a-b) - c \rvert = \lvert a - (b-c) \rvert$$
For a concrete example of this, choose $a = 5$, $b = 3$ and $c = 1$.
$$\lvert \lvert 5 - 3\rvert - 1\rvert = 1$$
$$\lvert 5 - \lvert 3 - 1\rvert \rvert = 3$$
Notice that my choice of counterexample is to demonstrate this: this is NOT true because subtraction is NOT associative for real numbers, let alone non-negative integers (i.e. $(a - b) -c \neq a - (b - c))$. So $f$ is NOT associative because it fails for a particular subset of non-negative integers.


*Identity

By definition of identity, it is an element $e$ such that $\forall a \in \mathbb{Z}_{\geq 0}$:
$$f(a, e) = \lvert a - e\rvert = \lvert e - a\rvert = f(e,a) = a$$
Can you show what non-negative integer $e$ satisfies this equation (if any)?
(Answer if you get stuck)
Take $e = 0$ and $e \in \mathbb{Z}_{\geq 0}$ and $f(a,e) = f(e,a) = a$. So $(\mathbb{Z}_{\geq 0}, f)$ has identity.


*Inverse

For any element $a \in \mathbb{Z}_{\geq 0}$, the inverse of $a$ is the element $a'$ such that:
$$f\left(a, a'\right) = \lvert a - a'\rvert = \lvert a' - a\rvert = f\left(a', a\right) = e$$
(where $e$ denotes the identity element if it exists)
Can you find a non-negative integer $a'$ such that the above equation is satisfied (if any)?
(Answer if you get stuck)
We verified that the identity $e$ exists, and it is $0$. So just plug this into the above equation and we get that:
$$f(a,a') = 0 \;\mathrm{iff}\; \lvert a - a' \rvert = 0$$
By definition of absolute value, $a = a'$. So $\forall a \in \mathbb{Z}_{\geq 0}$, $a$ is its own inverse.
(Conclusion)
Our conclusion is that $\left(\mathbb{Z}_{\geq 0}, f\right)$ is NOT a group because $f$ fails to be associative.
