I'm stuck with this problem:
$$ \lvert\max_a f(a) - \max_a g(a)\rvert \leq \max_a \lvert f(a) - g(a)\rvert $$ for any $f:\mathbb{R}\to\mathbb{R}$ and $g:\mathbb{R}\to\mathbb{R}$.
I would like to understand if the inequality is true, and, if this is the case, how to show it.
I tried with different instances of $f$ and $g$, and seems to be true. I tried to show by contradiction, but I'm not able to.
First note that a function $f:\mathbb{R}\to\mathbb{R}$ does not necessarily have a maximum (even if it continuous). It can be unbounded, e.g. $f(x) =x$, or bounded above without attaining the maximum, e.g. $f(x) = x^2/(1+x^2)$.
If $\max_a f(a)$, $\max_a g(a)$ and $\max_a \lvert f(a) - g(a)\rvert $ all exist then you can argue as follows: The maximum of $f$ is attained at some point $b$. Then $$ \max_a f(a) - \max_a g(a) = f(b) - \max_a g(a) \le f(b) - g(b) \leq \lvert f(b) - g(b)\rvert \leq \max_a \lvert f(a) - g(a)\rvert $$ and we have $$ \max_a f(a) - \max_a g(a) \leq \max_a \lvert f(a) - g(a)\rvert \, . $$ The same inequality holds with $f$ and $g$ interchanged, and therefore $$ \lvert\max_a f(a) - \max_a g(a)\rvert \leq \max_a \lvert f(a) - g(a)\rvert \, . $$
If $f$ and $g$ are only assumed to be bounded then a similar argument shows that $$ \lvert\sup_a f(a) - \sup_a g(a)\rvert \leq \sup_a \lvert f(a) - g(a)\rvert \, . $$