For any two functions $f_1 : [0,1] →\mathbb R$ and $f_2 : [0,1] →\mathbb R$, check which among the statements are true. 
For any two functions $f_1 : [0,1] →\mathbb R$ and $f_2 : [0,1]
 →\mathbb R$, deﬁne the function $g : [0,1] →\mathbb R$ as $g(x) =
 \max(f_1(x),f_2(x))$ for all $x ∈ [0,1]$. 
A. If $f_1$ and $f_2$ are linear, then $g$ is linear
B. If $f_1$ and $f_2$ are diﬀerentiable, then g is diﬀerentiable 
C. If $f_1$ and $f_2$ are convex, then g is convex 
D. None of the above

My attempt:- $g(x) =
 \max(f_1(x),f_2(x))=\frac{f_1(x)+f_2(x)}{2}+\frac{|f_1(x)-f_2(x)|}{2}$
A. $g(0)=\max\{f_1(0),f_2(0)\}=0$
$g(cx+y)=\max\{f_1(cx+y),f_2(cx+y)\}=\frac{f_1(cx+y)+f_2(cx+y)}{2}+\frac{|f_1(cx+y)-f_2(cx+y)|}{2}=\frac{cf_1(x)+f_1(y)+cf_2(x)+f_2(y)}{2}+\frac{|cf_1(x)+f_1(y)-(cf_2(x)+f_2(y))|}{2}=c\frac{f_1(x)+f_2(x)}{2}+\frac{f_1(y)+f_2(y)}{2}+\frac{|c(f_1(x)-f_2(x))+(f_1(y)-f_2(y))|}{2}$. $c(f_1(x)-f_2(x))$ and $(f_1(x)-f_2(x))$ lie in the same line. so, Equality holds in the triangular ineqality.
$c\frac{f_1(x)+f_2(x)}{2}+\frac{f_1(y)+f_2(y)}{2}+\frac{|c(f_1(x)-f_2(x))|}{2}+\frac{|(f_1(y)-f_2(y))|}{2}\implies$
$c\frac{f_1(x)+f_2(x)}{2}+\frac{f_1(y)+f_2(y)}{2}+|c|\frac{|(f_1(x)-f_2(x))|}{2}+\frac{|(f_1(y)-f_2(y))|}{2}$
It need not be linear. Since,If $c<0$, $|c|=-c$.
B. $\lim_{h\to 0}\frac{g(h)-g(0)}{h}=\lim_{h\to 0}\frac{f_1(h)+f_2(h)}{2h}+\frac{|f_1(h)-f_2(h)|}{2h}-(\frac{f_1(0)+f_2(0)}{2h}+\frac{|f_1(0)-f_2(0)|}{2h})=\lim_{h\to 0}\frac{f_1(h)-f_1(0)+f_2(h)-f_2(0)}{2h}+\frac{|f_1(h)-f_2(h)|}{2h}-\frac{|f_1(0)-f_2(0)|}{2h}$
How do I proceed further?
C. Let $x,y \in[0,1],g(tx+(1-t)y)=\max(f_1(tx+(1-t)y),f_2(tx+(1-t)y))=\frac{f_1(tx+(1-t)y)+f_2(tx+(1-t)y)}{2}+\frac{|f_1(tx+(1-t)y)-f_2(tx+(1-t)y)|}{2}\leq \frac{f_1(tx+(1-t)y)+f_2(tx+(1-t)y)}{2}+\frac{|f_1(tx+(1-t)y)|}{2}+\frac{f_2(tx+(1-t)y)|}{2}$
How do I proceed further?
I couldn't find any counterexample for $B$ and $C$. So, I tried to prove it. I am not able to complete the proof. Plese help me.
 A: B. is false. Just take $f(x)=x$ and $g(x)=1-x$.
C. is true. It follows from the definition of convex function.
A: A. is not true. $f_1(x) = x$ and $f_2(x) = 1-x$.
B. is not true, see above, not differentiable at $x =\frac{1}{2}$.
C. is true though. Plug in definition of a convex function.
A: For a counterexample to B, consider two linear functions, one sloping upward and one sloping downward, crossing in the middle, so that the max is V-shaped and thus has a point of nondifferentiability (this would also be a counterexample to A).
For C, since convexity is defined in terms if inequalities, it's probably just easier to use the $\max$ definition directly than to use your decomposition. $$tg(x)+(1-t)g(y) \geq tf_1(x)+(1-t)f_1(y) \geq f_1(tx+(1-t)y)$$
and
$$tg(x)+(1-t)g(y) \geq tf_2(x)+(1-t)f_2(y) \geq f_2(tx+(1-t)y)$$
thus
$$tg(x)+(1-t)g(y) \geq \max\{f_1(tx+(1-t)y),f_2(tx+(1-t)y)\} = g(tx+(1-t)y)$$
A: Regarding $C.$
If $f_1(x) \ge f_2(x)$ and $f_1(y) \ge f_2(y)$
$\lambda g(x) + (1-\lambda)g(y) =  \lambda f_1(x) + (1-\lambda)f_1(y) \ge f_2(x\lambda + (1-\lambda)y)$
and 
$\lambda g(x) + (1-\lambda)g(y) \ge  \lambda f_2(x) + (1-\lambda)f_2(y) \ge f_2(x\lambda + (1-\lambda)y)$
If $f_1(x) \ge f_2(x)$ and $f_2(y) \ge f_1(y)$
$\lambda g(x) + (1-\lambda)g(y) \ge  \lambda f_1(x) + (1-\lambda)f_1(y)$
and
$\lambda g(x) + (1-\lambda)g(y) \ge  \lambda f_2(x) + (1-\lambda)f_2(y)$ 
But $g(x\lambda + (1-\lambda)y)$ equals either $f_1(x\lambda + (1-\lambda)y)$ or $f_2(x\lambda + (1-\lambda)y)$
$g(x\lambda + (1-\lambda)y) \ge g(x\lambda + (1-\lambda)y)$
