Maths WorkshopMaths problems with full solutions
Exercise 80Calculus › Single-variable calculus › Continuity › Continuous and discontinuous functionsL1Added 2 Nov 2026

Maximum and minimum of two continuous functions

#continuity#absolute value#algebra of continuous functions

Statement

Let f,g:I→Rf,g:I\to\mathbb{R} be continuous. Show that max⁡(f,g)\max(f,g) and min⁡(f,g)\min(f,g) are continuous.

Hint

Express the maximum and the minimum with an absolute value: max⁡(u,v)=u+v+∣u−v∣2\max(u,v)=\frac{u+v+|u-v|}{2}.

Show solutionHide solution

Solution

The formulas. For real numbers u,vu,v,
max⁡(u,v)=u+v+∣u−v∣2,min⁡(u,v)=u+v−∣u−v∣2.\max(u,v)=\frac{u+v+|u-v|}2,\qquad \min(u,v)=\frac{u+v-|u-v|}2.
To check the first one, distinguish u≥vu\ge v (then ∣u−v∣=u−v|u-v|=u-v and the right side is uu) and u<vu<v (then it is vv). The second is similar.

Conclusion. The functions f+gf+g and f−gf-g are continuous (sums of continuous functions), so ∣f−g∣|f-g| is continuous (previous problem). Hence max⁡(f,g)=12(f+g+∣f−g∣)\max(f,g)=\frac12(f+g+|f-g|) and min⁡(f,g)=12(f+g−∣f−g∣)\min(f,g)=\frac12(f+g-|f-g|) are continuous.

Application. Setting f+=max⁡(f,0)f^+=\max(f,0) and f−=max⁡(−f,0)f^-=\max(-f,0) shows that the positive and negative parts of a continuous function are continuous, and f=f+−f−f=f^+-f^-.