Is the max of two differentiable functions piecewise-differentiable? The question here asks:

Given that $f$ and $g$ are two real functions and both are differentiable, is it true to say that $h=max(f,g)$ is differentiable too?

Convincing arguments have been presented there that the answer is No.
So, how about a slightly weaker question:  Given that $f$ and $g$ are two real, differentiable functions, is it always true that $h=max(f,g)$ is piecewise-differentiable?
(For the purposes of this question, 'piecewise' is to be taken as user86418 defined it in a comment: "The domain can be divided into subintervals so that the set of endpoints is discrete", i.e., "each endpoint is isolated in the set of endpoints."  Further, the set of endpoints may or may not be finite.)  
 A: With the indicated definition of "piecewise", the answer is no: If $g$ is the zero function and
$$
f(x) = \begin{cases}
  x^{2} \sin(1/x) & \text{if $x \neq 0$,} \\
  0 & \text{if $x = 0$,}
\end{cases}
$$
(which is well-known to be everywhere-differentiable), then their maximum,
$$
\max(f, g)(x) = \frac{f(x) + \left|f(x)\right|}{2}
$$
fails to be differentiable at each point $x$ with $\sin(1/x) = 0$, namely for $x_{n} = 1/(n\pi)$ with $n \neq 0$ an integer, since $f'(x_{n}) \neq 0 = g'(x_{n})$. (Vertical scale below exaggerated for clarity.)

Since the set of "corners",
$$
E = \{1/(n\pi) : n \neq 0\},
$$
has $0$ as a limit point, $\max(f, g)$ is not piecewise-differentiable.
A: Suppose $f,g : \mathbb {R}\to \mathbb {R}$ are differentiable and $E$ is the set of points where $\max(f,g)$ is not differentiable. Then every point in $E$ is isolated in $E.$ In particular, $E$ is countable. Furthermore, the right derivative and left derivative of $\max(f,g)$ exist at every point of $E$ (hence at every point of $\mathbb {R}$).
Proof: Let's go through some cases. Suppose $f(a)\ne g(a).$ WLOG, $f(a)< g(a).$ Then by continuity, $f<g$ in a neighborhood of $a.$ Thus $\max (f,g)=g$ in a neighborhood of $a,$ which implies $\max (f,g)$ is differentiable in a neighborhood of $a.$ So such an $a$ is not in $E.$
Now suppose $f(a)= g(a).$ Two subcases: (i) $f'(a)\ne g'(a).$ WLOG, $f'(a)< g'(a).$ Then $g\ge f$ in $[a,a+\delta)$ for some $\delta > 0.$ That implies $\max (f,g)=g$ in that interval, hence $\max (f,g)$ is differentiable in $[a,a+\delta),$ with the right derivative at $a$ equal to $g'(a).$ Similarly, $\max (f,g)=f$ in some $(a-\delta,a],$ hence $\max (f,g)$ is differentiable there, with the left derivative at $a$ equal to $f'(a).$ Since the right and left derivatives at $a$ disagree, $a\in E,$ but $\max(f,g)$ is differentiable elsewhere in $(a-\delta,a+\delta).$
The other subcase is $f(a)= g(a), f'(a)= g'(a).$ Here we have a common tangent line, let's call it $l(x).$ By definition of a derivative, near $a$ we have
$$f(x) = l(x) + r(x)(x-a), g(x) = l(x) + s(x)(x-a),$$
where both $r(x), s(x) \to 0$ as $x\to a.$ It follows that 
$$l(x) - |x-a|(|r(x)| + |s(x)|) \le \max (f,g)(x) \le l(x) + |x-a|(|r(x)| + |s(x)|)$$ near $a.$ This shows $\max(f,g)'(a)$ exists, so this $a\not \in E.$
Put all this together to get the claims made at the beginning of this post.
A: Obviously, it depends on what you mean by "piecewise differentiable." I'll show the following:
Claim: There exists a differentiable function $f: [0,1] \rightarrow \mathbb R$, such that if $R$ is the set where the function $\max\{f,0\}$ is differentiable, $R$ cannot be written as a countable union of intervals.
I'd argue that this $f$ is therefore not piecewise differentiable, for any reasonable definition of "piecewise differentiable".
Proof of Claim:
Step 1. Constructing $f$:
For $m \geq 0$, let $\mathcal A_m$ be the space of $m$-tuples $(a_1, ..., a_m)$ where each $a_i$ is either $0$ or $2$. If $A \in \mathcal A_m$, we define the open interval $I_A = (b_A + \frac 13 3^{-m}, b_A + \frac 23 3^{-m})$, where $b_A = \sum_{i=1}^m a_i 3^{-i}$. One can check that these intervals are disjoint.
The intervals $I_A$ for $A \in \mathcal A_m$ are precisely the open intervals removed in step $(m+1)$ in the standard construction of the Cantor set. So we can set
$$C = [0, 1] \setminus \bigcup_{m=0}^\infty \bigcup_{A \in \mathcal A_m} I_A\text;$$
this is then the standard Cantor set.
We will define $f$ as follows: If $x \in C$, then we set $f(x) = 0$. Otherwise, there is a unique $m \geq 0$ and a unique $A \in \mathcal A_m$ such that $x \in I_A$. We can write $I_A = (c_A, d_A)$, where $d_A - c_A = 3^{-m-1}$. Let $z(x) = 3^{m+1}(x - c_A)$, and let $f(x) = 3^{-2m-2} h(z(x))$, where $h(z) = z^2 (z-1)^2 (z-1/2)$. (The precise form of $h$ doesn't matter; the properties we need are that $h(0) = h'(0) = h(1) = h'(1) = h(1/2) = 0$, and $h'(1/2) \neq 0$.)
[A less formal but more readable definition of $f$: In each of the intervals that you remove to get a Cantor set, glue in a copy of $h$ above, where the values are rescaled according to the square of the length of the interval.]
Step 2. Check that $f$ is differentiable:
In the interior of each $I_A$, it is clear that $f$ is differentiable, since it is defined as a composition of differentiable functions. So we only need to check that $f$ is differentiable at each point in $C$. In fact, I claim that $f'(x) = 0$ whenever $y \in C$:
To show this, we will prove that $\lvert f(x)\rvert \leq (x-y)^2$ for all $x \in [0,1]$. To see this, suppose that $x \in I_A$, where $A \in \mathcal A_m$ for some $m$. (If not, then by definition $f(x) = 0$, and the inequality is obviously true.) Again, write $I_A = (c_A, d_A)$. Certainly, $\lvert x-y\rvert \geq d$, where $d = \min \{x-c_A, d_A - x\}$ is the distance from $x$ to the boundary of $I_A$. Referring to $z(x)$ from the definition of $f$, it follows that $\lvert x-y\rvert \geq 3^{-m-1} \min\{z(x), 1 - z(x)\}$. For $0 \leq z \leq 1$, it is easy to check that $\lvert h(z)\rvert \leq (\min \{z, 1-z\})^2$. Piecing everything together, the definition $f(x) = 3^{-2m-2} h(z(x))$ gives $\lvert f(x)\rvert \leq (x-y)^2$.
From this inequality, the definition of the derivative quickly shows that $f'(y) = 0$. 
Step 3. The set where $\max\{f, 0\}$ is not differentiable:
Let $g = \max\{f, 0\}$. Let $S$ be the set of midpoints of the intervals $I_A$, for $A \in \bigcup_{m=0}^\infty \mathcal A_m$. I claim if $x \in S$, then $g$ is not differentiable at $x$.
This is pretty easy to check. In fact, if $x$ is the midpoint of $I_A$, where $A \in \mathcal A_m$, then using the chain rule, we can check that $f'(x) = 3^{-m-1} h'(1/2) = 3^{-m-1}/4$. This will be the right derivative of $g$ at $x$, whereas the left derivative will be zero, so $g$ is not differentiable at $x$.
Step 4. The set of points where $g$ is differentiable cannot be written as a countable union of intervals:
Suppose that $I$ is an interval where $g$ is differentiable. Then $I$ can contain at most one point of $C$, because between any two points of $C$, there must be one of the ""removed intervals" $I_A$, and therefore one point of $S$. Since the Cantor set $C$ is uncountable, this shows that $[0,1] \setminus S$ cannot be written as the union of such intervals.
A: There's a theorem that says that if $f(x)$ is monotonically increasing, then it's differentiable almost everywhere, which for your purposes suffices to be called "piece-wise" differentiable [really it's differentiable at almost any location but not necessarily on intervals]. So the statement should be true for functions $f,g$ which are of bounded variation since they can be written as the difference of monotonically increasing functions. 
