Difference between using max function over functions and over values I was wondering if someone could explain what is the difference between the max of a finite number of functions and the max of a finite number of function values.
For instance, as shown here, given real-valued continuous functions $f,g$, the following inequality holds.
$\max(f+g)(z)\leq \max f(z)+\max g(z), \forall z \in Z$.
However, if I define the functions $ g= \max_{i \in I}\{g_i\}$, $ h= \max_{j \in J}\{h_j\}$, and let $f= g+h$, then $f$ can be represented as
$ f = \max_{i \in I,j \in J}\{g_i+h_j\}$
rather than writing as
$f = \max_{i \in I}\{g_i\} + \max_{j \in J}\{h_j\} \leq   \max_{i \in I,j \in J}\{g_i+h_j\}$.
My question is why equality holds when we work with indices. What exactly am I misinterpreting?
 A: 
The inequality stated in the referred question is given as
\begin{align*}
\color{blue}{\max\{f+g\}\leq \max\{f\}+\max\{g\}\qquad\qquad x\in[a,b]}\tag{1}
\end{align*}
where we assume $f,g$ being real-valued continuous functions with domain $[a,b]$ to assure that a maximum exists.

Note that (1) is not an inequality of functions but an inequality of real numbers. We have
\begin{align*}
\max\{f+g\}&=\max_{x\in[a,b]}\{(f+g)(x)\}=\max_{x\in[a,b]}\{f(x)+g(x)\}\in\mathbb{R}\\
\max\{f\}&=\max_{x\in[a,b]}\{f(x)\}\in\mathbb{R}\\
\max\{g\}&=\max_{x\in[a,b]}\{g(x)\}\in\mathbb{R}\\
\end{align*}
Each of the three maxima above specifies a maximum of the values of a single function with domain $[a,b]$, namely $f+g,f$ and $g$.
We have a different situation when we consider a (finite) family $\left(g_i\right)_{i\in I}$ of functions $g_i$ with $I$ finite. In this case the symbol
\begin{align*}
\max_{i\in I}\{g_i\}\tag{2}
\end{align*}
denotes  often not a maximum of real values, but rather a maximum of functions $g_i, i\in I$ instead. We also need an order relation on the function-space $\mathcal{C}_{\mathbb{R}}\left([a,b]\right)$ of real-valued continuous functions on $[a,b]$ in order to be able to talk about maxima.

But here we want to use $\max_{i\in I}\{g_i\}$ somewhat differently, namely as
\begin{align*}
\max_{i\in I}\{g_i\}:= \max_{{i\in I}\atop {x\in[a,b]}}\{g_i(x)\}\in\mathbb{R}\tag{3}
\end{align*}
In (3) we have as in (1) the maximum being a real number of just a set of real numbers
\begin{align*}
\{g_i(x):i\in I, x\in[a,b]\}.
\end{align*}
Next we consider two (finite) families $(g_i)_{i\in I}$ and $(h_j)_{j\in J}$. We have
\begin{align*}
\max_{i\in I,j\in J}\{g_i+h_j\}&=\max_{{i\in I,j\in J}\atop {x\in [a,b]}}\{(g_i+h_j)(x)\}\in\mathbb{R}\\
\max_{i\in I}\{g_i\}&=\max_{{i\in I}\atop {x\in [a,b]}}\{g_i(x)\}\in\mathbb{R}\\
\max_{j\in J}\{h_i\}&=\max_{{j\in J}\atop {x\in [a,b]}}\{h_j(x)\}\in\mathbb{R}\\
\end{align*}
and derive consequently in the same way as in (1)
\begin{align*}
\color{blue}{\max_{i\in I,j\in J}\{g_i+h_j\}\leq \max_{i\in I}\{g_i\}+\max_{j\in J}\{h_j\}\qquad\qquad x\in[a,b]}
\end{align*}

