Lemma Let $X$ compact metric space and $K \subset C(X, \mathbb{R})$ the subalgebra containing all constant functions and $f,g \in K$ two functions. Then, $|f|, \max(f,g), \min(f,g) \in \overline{K}$, where $\overline{E}$ denotes the closure of some set $E$.
Question Our proof is rather complicated and seems to be cracking a nut with a sledgehammer. If $f$ and $g$ are constant, aren't $|f|, \max(f,g), \min(f,g)$ also constant functions and therefore trivially in $K$? So why do we even need a the closure at all?
As already said, just because your subalgebra contains all constant functions, doesn't mean that it consists only of constant functions. So your Question should be answered.