Let β£β
β£ be the absolute value, and regard R as a metric space through the metric dRβ of The Absolute Value Metric on the Real Line, and let TdRββ be the collection of subsets of R that are open in (R,dRβ), which is a topology on R by Metric Open Sets Form a Topology. By An Open Interval is an Interval All of Whose Points Are Interior the set (p,q) is an interval all of whose points are interior points of it. Let [a,b] be the closed interval of Interval in the Real Line. Claim numbers refer to Elementary Order Arithmetic in an Ordered Field and Properties of the Absolute Value in an Ordered Field as indicated.
Step 1: [a,b]β(p,q). If xβ[a,b] then aβ€xβ€b with a,bβ(p,q), so xβ(p,q) because (p,q) is an interval.
Step 2: [a,b] is nonempty and compact. It contains a. Since a<b, the strict order gives aβ€b, so Closed Interval [a,b] is Compact in R applies and shows that [a,b] is compact in (R,TdRββ).
Step 3: the restriction of g to [a,b] is continuous. Let xβ[a,b]. By Step 1, xβ(p,q), and g is differentiable at x, so by Differentiability at a Point Implies Continuity There g is continuous at x relative to (p,q). The defining condition quantifies over points of the domain, and [a,b]β(p,q), so the same Ξ΄ witnesses continuity at x relative to [a,b] of the restriction g0β of g to [a,b]. Hence g0β is continuous on [a,b].
Step 4: extrema. By claim 2 of Semicontinuity Under Negation and Characterization of Continuity applied at each point, g0β is both upper semicontinuous and lower semicontinuous on [a,b]. By Semicontinuous Functions Attain Their Extrema on a Compact Set, applied to the metric space (R,dRβ) and the nonempty compact subset [a,b], there are xmaxβ,xminββ[a,b] with g(x)β€g(xmaxβ) and g(xminβ)β€g(x) for every xβ[a,b].
Step 5: a local extremum strictly between a and b. We produce c with a<c<b at which g has a local maximum or a local minimum relative to (p,q).
First a remark used twice. Suppose a<c<b and let Ξ΄ be the least of cβa and bβc, which exists by claim 9 and is positive by claim 1. If yβ(p,q) satisfies β£yβcβ£<Ξ΄, then βΞ΄<yβc<Ξ΄ by claim 9 of Properties of the Absolute Value in an Ordered Field, so by claim 1 we get cβΞ΄<y<c+Ξ΄; since Ξ΄β€cβa gives aβ€cβΞ΄ and Ξ΄β€bβc gives c+Ξ΄β€b, claim 2 yields aβ€yβ€b, that is yβ[a,b].
Case 1: g(xmaxβ)=g(a) and g(xminβ)=g(a). Then every xβ[a,b] satisfies g(a)=g(xminβ)β€g(x)β€g(xmaxβ)=g(a), so g(x)=g(a) by antisymmetry. Let c=(a+b)β
2β1. From a<b: claim 1 gives a+a<a+b and a+b<b+b, and claim 10 with the multiplier 2β1, positive by claim 8, gives a<c and c<b. With Ξ΄ as in the remark, every yβ(p,q) with β£yβcβ£<Ξ΄ lies in [a,b], so g(y)=g(a)=g(c) and in particular g(y)β€g(c). So g has a local maximum at c relative to (p,q).
Case 2: g(xmaxβ)ξ =g(a). Since aβ[a,b] we have g(a)β€g(xmaxβ), hence g(a)<g(xmaxβ). Also g(b)=g(a)<g(xmaxβ). So xmaxβξ =a and xmaxβξ =b, while aβ€xmaxββ€b; hence a<xmaxβ<b. Put c=xmaxβ and take Ξ΄ as in the remark: every yβ(p,q) with β£yβcβ£<Ξ΄ lies in [a,b], so g(y)β€g(xmaxβ)=g(c). So g has a local maximum at c relative to (p,q).
Case 3: g(xminβ)ξ =g(a). Symmetrically g(xminβ)<g(a)=g(b), so a<xminβ<b; putting c=xminβ and taking Ξ΄ as in the remark gives g(c)β€g(y) for every yβ(p,q) with β£yβcβ£<Ξ΄, so g has a local minimum at c relative to (p,q).
The three cases are exhaustive, since if Case 1 fails then g(xmaxβ)ξ =g(a) or g(xminβ)ξ =g(a).
Step 6. In every case c satisfies a<c<b, so cβ(a,b), and g is differentiable at c. By Vanishing of the Derivative at an Interior Local Extremum, gβ²(c)=0.