# Min of continuous functions

Question: Prove for $f,g$ continuous on a metric space $(X,d)$ then $h(x) = \text{min}\{f(x), g(x)\}$ is continuous.

I've proved for the case of $h(x) = \text{max}\{f(x), g(x)\}$, and min follows almost identically. However, I am unsure if case 2 is correct in the proof below:

Proof: Let $\epsilon > 0$ and suppose there exists some point $a \in X$. We have $f$ is continuous so it is continuous at $a$. Then there exists a $\delta_f$ such that $$|x - a| < \delta_f ~~~~~\text{and}~~~~~ |f(x) - f(a)| < \epsilon.$$ By the same argument for $g$, there exists a $\delta_g$ such that $$|x - a| < \delta_g ~~~~~\text{and}~~~~~ |g(x) - g(a)| < \epsilon.$$ Now we show that $h$ is continuous at $a$. Let $\delta = \text{min}\{\delta_f, \delta_g\}$ such that $|x - a| < \delta$. Suppose $h(a) = f(a)$ and $f(a) \leq g(a)$. Then we have two cases.

Case 1: $h(x) = f(x)$.

$|h(x) - h(a)| = |f(x) - f(a)| < \epsilon$, and $h$ is continuous at $a$.

Case 2: $h(x) = g(x)$, which occurs iff $g(x) \leq f(x)$. Thus, $$g(x) - g(a) \leq g(x) - f(a) \leq f(x) - f(a) < \epsilon.$$ But, we also have that $g(x) - g(a) > -\epsilon$. Hence, $|h(x) - h(a)| = |g(x) - f(a)| < \epsilon$. Therefore, $h$ is continuous at $a$, and is a continuous function.

• $f$ and $g$ should be symmetric so you can just use the phrase "without loss of generality". There should be no differences in "case 1" or "case 2". – user223391 Oct 6 '17 at 2:15

Note that $$\min (a, b)=\dfrac {a+b-\vert a-b\vert}{2}$$ then $$h(x)=\min(f(x), g(x))=\dfrac {f(x)+g(x)-\vert f(x)-g(x)\vert}{2}$$ since $f(x),g(x)$ are continuous, so do $\dfrac {f(x)+g(x)}{2}$ and $\dfrac {f(x)-g(x)}{2}$
also note that $\dfrac {\vert f(x)-g(x)\vert}{2}$ is continuous since it's the composition of $u(x)=\vert x \vert$ and $\dfrac {f(x)-g(x)}{2}$, where $u(x)$ is also continuous. Now $h(x)$ is continuous.