Why is $\max(x, x')$ equivalent to $\frac{1}{2}( x + x' + |x - x' |)$? Why is it that 
$$\max(x, x') = \frac{1}{2}( x + x' + |x - x'|)$$
is true? Is it supposed to be obvious? Because it seems to come out of thin air for me. Anyway, I've verified this by plotting it in matlab, so it works, but its hardly a satisfying proof/justification.
I've actually have been shown a proof but I am unable to internalize and understand it properly. I will provide it below:
$$\begin{align*}
\max(x, x') &= \max\left(x - \frac{1}{2}(x + x'),\; x' - \frac{1}{2}(x + x')\right) + \frac{1}{2}(x + x')\\\\
&=\max\left(\frac{1}{2}(x - x'), \frac{1}{2}(x' - x)\right) + \frac{1}{2}(x + x')\\\\
&=\max\left(\frac{1}{2}(x' - x), \frac{1}{2}(x - x')\right) + \frac{1}{2}(x + x')\\\\
&=\max\left(-\frac{1}{2}(x - x'), \frac{1}{2}(x - x')\right) + \frac{1}{2}(x + x')\\\\
&=\left| \frac{1}{2}(x - x')\right| + \frac{1}{2}(x + x') \\\\
&= \frac{1}{2}( x + x' + |x -x'| )
\end{align*}$$
The only line that remains a mystery for me is actually the first line. 
$$ \max(x, x') = \max\left(x - \frac{1}{2}(x + x'),\; x' - \frac{1}{2}(x + x')\right) + \frac{1}{2}(x + x') $$
After that everything seems to be simple algebra manipulations, except for the cool use of the identity
$$\left| \frac{1}{2}(x - x')\right| = \max\left(-\frac{1}{2}(x - x'), \frac{1}{2}(x - x')\right)$$ which makes sense to me.
If anyone has a good explanation of why that step is true, I'd be very thankful. Also, and maybe more importantly, that first step seems like magic to me, I have no idea where it came from and if someone has a good explanation for that too, that would be awesome. I'd like to understand this not only to see why its correct, but also to understand how one would have come up with such a result.

For determining the maximum of two arguments $x$, $x'$ we need the case distinction which of the two arguments is larger. 
For determining the absolute value of one argument $x$ one again needs a case distinction, here if the argument is negative or not.
So it is not that surprising that one can express the maximum in terms of the absolute value.
$$
\lvert x - x'\rvert =
\begin{cases}
x - x' & \mbox{for} & x - x' \ge 0 \iff x \ge x' \\
-(x - x') & \mbox{for} & x - x' < 0 \iff x < x' 
\end{cases}
$$
so
\begin{align}
x + x ' + \lvert x - x'\rvert 
&=
\begin{cases}
x + x' + x - x' & \mbox{for} & x \ge x' \\
x + x' - (x - x') & \mbox{for} & x < x' 
\end{cases} 
\\
&= 
\begin{cases}
2x & \mbox{for} & x \ge x' \\
2x' & \mbox{for} & x < x' 
\end{cases}
\end{align}
which gives
$$
\max(x,x') = \frac{x + x ' + \lvert x - x'\rvert}{2} 
$$
Similar one shows
$$
\min(x,x') = \frac{x + x ' - \lvert x - x'\rvert}{2} 
$$
