TITLE: continuity of $\max \{f_1(x),f_2(x),\cdots,f_m(x) \}$ at $a$
QUESTION [7 upvotes]: let $f_1,\cdots, f_m$ be a real valued functions defined on a set $S$ in $\mathbb R^n$. Assume that each $f_k$ is continuous at the point $a$ of $S$. For each $x \in S : f(x) = \max \{f_1(x),f_2(x),\cdots,f_m(x) \}$. Discuss continuity of $f$ at $a$.
Attempt: I am trying to prove this without using induction. Each $f_k$ is continuous $\implies $
$\forall \epsilon>0, \exists \delta_1 >0$ s.t $|f_1(x)-f_1(a)|< \epsilon$ whenever $|x-a|<\delta_1$
$\forall \epsilon>0, \exists \delta_2 >0$ s.t $|f_2(x)-f_1(a)|< \epsilon$ whenever $|x-a|<\delta_2$
... 
$\forall \epsilon>0, \exists \delta_m >0$ s.t $|f_m(x)-f_m(a)|< \epsilon$ whenever $|x-a|<\delta_m$
$\forall \epsilon>0, \exists \delta_k >0$ s.t $\max |f_k(x)-f_k(a)|< \epsilon$ whenever $|x-a|<\delta_k$
$\implies \max |f_k(x)-f_k(a)|< \epsilon $ whenever $|x -a|<\delta =  \min\{\delta_1,\cdots, \delta_m\}$
and $\max |f_k(x)-f_k(a)| > |\max f_k(x)-\max f_k(a)| $
$\implies |\max f_k(x)-\max f_k(a)| < \epsilon$ whenever $|x-a|<\delta = \min\{\delta_1,\cdots, \delta_m\}$
Am I correct?
Thank you for your help

REPLY [7 votes]: Generalise the formula:
$$\max\{f,g\} = \frac{1}{2}(f+g+|f-g|)$$