Let $E$ be the set of all real-valued continuous functions on $[a,b]$ and for 2 functions $f$ and $g$ in $E$, let $d(f,g) = \displaystyle\max_{x \in [a,b]}|f(x)-g(x)|$. Prove that $(E,d)$ is a metric space.
I know how to prove the first 3 properties of a metric space, but I do not know how to prove the triangle inequality.
Let $f,g,h\in E$. We need to show that $d(f,h)\leqslant d(f,g) + d(g,h)$.
For any $x\in [a,b]$ we have $$|f(x)-h(x)| = |f(x) -g(x) + g(x) - h(x)| \leqslant |f(x)-g(x)| + |g(x)-h(x)|. $$ Taking the $\max$ over $[a,b]$ it follows that $$ \max_{x\in[a,b]} |f(x)-h(x)| \leqslant \max_{x\in[a,b]}(|f(x)-g(x)| + |g(x)-h(x)|). $$ Now, since $$\max_{x\in[a,b]}(|f(x)-g(x)|+|g(x)-h(x)|) \leqslant \max_{x\in[a,b]}|f(x)-g(x)| + \max_{x\in[a,b]}|g(x)-h(x)|, $$ we have $$ d(f,h) = \max_{x\in[a,b]}|f(x)-h(x)| \leqslant \max_{x\in[a,b]}|f(x)-g(x)| + \max_{x\in[a,b]}|g(x)-h(x)| = d(f,g) + d(g,h), $$ as desired.