How do I prove that $\max(x,\max(y,z)) = \max(\max(x,y),z))$ using an algebraic formula? The maximum of two numbers can be expressed by
$$\max(x,y) = \frac12\left(x+y+|x-y|\right)$$
Consequently, we can write
$$\max(x,\max(y,z))=\frac{1}{4}\left(2x+y+z+|y-z|+|2x-y-z-|y-z||\right)$$
$$\max(\max(x,y),z)=\frac{1}{4}\left(x+y+2z+|x-y|+|-x-y+2z-|x-y||\right)$$
Since we know the values on the left are equal, the expressions on the right should be, too. However, I don't know how to show that those expressions are the same.

From
$$\max(x,\max(y,z))=\frac{1}{4}\left(2x+y+z+|y-z|+|2x-y-z-|y-z||\right)$$
$$\max(\max(x,y),z)=\frac{1}{4}\left(x+y+2z+|x-y|+|-x-y+2z-|x-y||\right)$$
Let $y-z=a, x-y=b$, so $z=y-a, x=y+b, x-z=a+b$.
Then
$$\frac{1}{4}\left(x+2y+z+b+|a|+|2x-y-z-|y-z||\right)$$
$$\frac{1}{4}\left(x+2y+z-a+|b|+|-x-y+2z-|x-y||\right)$$
and
$$\frac{1}{4}\left(x+2y+z+b+|a|+|2x-y-z-|a||\right)$$
$$\frac{1}{4}\left(x+2y+z-a+|b|+|-x-y+2z-|b||\right)$$
and
$$\frac{1}{4}\left(x+2y+z+b+|a|+|a+2b-|a||\right)$$
$$\frac{1}{4}\left(x+2y+z-a+|b|+|-2a-b-|b||\right)$$
and using $|x|=x, x\gt0, |x|=-x, x\lt0$ we evaluate the last absolute term of the first and second equations independently for the four cases of the signs of $a$ and $b$ 
\begin{array}{|c|c|c|}
\hline
\frac{a}{b}&-&+\\
\hline
-&2|a+b|,2|a|&2|b|,2|a|\\
\hline
+&2|a+b|,2|a+b|&2|b|,2|a+b|\\
\hline
\end{array}
with the first entry in a cell being relevant to the first equation, etc..
For example if $a\gt0, b\lt0$ eqn 1 reads
$$|a+2b-|a||=|a+2b-a|=|2b|=2|b|$$
and eqn 2
$$|-2a-b-|b||=|-2a-b+b|=|-2a|=2|a|$$
as $-|b|=b$.
Replacing each last term with the associated cell, the equations match.
If $a,b$ are the same sign, $|a+b|=|a|+|b|$, otherwise they cancel as a whole.
For example $a\lt0,b\gt0$
$$b+|a|+|a+2b-|a||=b+|a|+2|a+b|$$
$$-a+|b|+|-2a-b-|b||=-a+|b|+2|a+b|$$
As  $a\lt0, -a=|a|$ and as $b\gt0, |b|=b$
so we get
$$=b+|a|+2|a+b|$$
$$=|a|+b+2|a+b|$$
which are equal.
