During the proof of the Stone-Weierstrass Theorem there is a lemma given:
Lemma: Let $g_{1}$ and $g_{2}$ be in $\mathcal{A}$ (an algebra of real-valued continuous functions which strongly separates points in an arbitrary compact metric space $M$). Then for every error $1/m$ there exist functions $g_{3}$ and $g_{4}$ in $\mathcal{A}$ such that $|g_{3}-\max(g_{1},g_{2})| \le 1/m$ and $|g_{4}-\min(g_{1},g_{2})| \le 1/m$ for all points of $M$.
The proof of the lemma starts of by saying that it suffices to prove the following: if $g$ is in $\mathcal{A}$ then there exists $g_{1}$ in $\mathcal{A}$ with $|g_{1}-|g|| \le 1/m$. I'm sure this is quite trivial but I can't justify why it's sufficient to prove this statement. Could someone explain why?
You have $\max(f,g)=\frac12(f+g+|f-g|)$ and $\min(f,g)=\frac12(f+g-|f-g|)$. So if you can approximate $|f-g|$ well, you can approximate $\min$ and $\max$.