Suppose, seeking a contradiction, that 0<f(x0β) for some x0ββ[a,b], and put Ξ΅=f(x0β)/2, so that 0<Ξ΅ and f(x0β)βΞ΅=Ξ΅.
Step 0: a global upper bound for f. Since a<b and f is continuous on [a,b], Extreme Value Theorem on a Closed Real Interval gives a point xmaxββ[a,b] with f(x)β€f(xmaxβ) for every xβ[a,b]. Put M=f(xmaxβ), so that
0β€f(x)β€MforΒ everyΒ xβ[a,b],
using also the hypothesis 0β€f(x). The same two inequalities then hold for every x in any subset of [a,b], in particular on every closed subinterval used below.
Step 1: a nondegenerate subinterval on which fβ₯Ξ΅. Since f is continuous at x0β, there is Ξ΄>0 such that every xβ[a,b] with β£xβx0ββ£<Ξ΄ satisfies β£f(x)βf(x0β)β£<Ξ΅ and hence
f(x)>f(x0β)βΞ΅=Ξ΅.
Put Ο=min{Ξ΄,Β bβa}/2. Then 0<Ο, Ο<Ξ΄ and 2Οβ€bβa. Set
u=max{a,Β x0ββΟ},v=min{b,Β x0β+Ο}.
Then aβ€uβ€b and aβ€vβ€b, and since aβ€x0ββ€b we have uβ€x0ββ€v.
We check that Οβ€vβu, by considering which of the two arguments realises each of u and v. If u=a and v=b, then vβu=bβaβ₯2Οβ₯Ο. If u=a and v=x0β+Ο, then vβu=(x0ββa)+Οβ₯Ο, since aβ€x0β. If u=x0ββΟ and v=b, then vβu=(bβx0β)+Οβ₯Ο, since x0ββ€b. If u=x0ββΟ and v=x0β+Ο, then vβu=2Οβ₯Ο. In every case Οβ€vβu, and since 0<Ο we get u<v.
Finally, x0ββΟβ€u and vβ€x0β+Ο, so every xβ[u,v] satisfies x0ββΟβ€xβ€x0β+Ο, that is, β£xβx0ββ£β€Ο<Ξ΄. As [u,v]β[a,b], the display above applies and gives Ξ΅<f(x), in particular
Ξ΅β€f(x)forΒ everyΒ xβ[u,v].
Step 2: splitting the integral. By A Continuous Function on a Closed Interval is Riemann Integrable Β§integrable, f is Riemann integrable on [a,b], so the additivity lemma may be applied to it. Applying Additivity of the Riemann Integral on Adjacent Intervals to the triple aβ€uβ€b shows that the restrictions of f to [a,u] and to [u,b] are Riemann integrable and that
β«abβf(t)dt=β«auβf(t)dt+β«ubβf(t)dt.
Applying the same lemma to the restriction of f to [u,b] and the triple uβ€vβ€b shows that the restrictions to [u,v] and [v,b] are Riemann integrable and that β«ubβf=β«uvβf+β«vbβf. Combining,
β«abβf(t)dt=β«auβf(t)dt+β«uvβf(t)dt+β«vbβf(t)dt.
Step 3: the outer two pieces are nonnegative. Consider β«auβf. If a<u, then 0β€f(t)β€M for every tβ[a,u] by Step 0, so clause 2 of Uniform Partitions and Order Bounds for the Riemann Integral applied with these bounds m=0 and M gives 0β€β«auβf(t)dt. If a=u, then applying Additivity of the Riemann Integral on Adjacent Intervals to the triple aβ€aβ€b gives β«abβf=β«aaβf+β«abβf, whence β«aaβf=0. In both cases 0β€β«auβf(t)dt.
The same argument applies to β«vbβf: if v<b then 0β€f(t)β€M for every tβ[v,b] by Step 0, and clause 2 of Uniform Partitions and Order Bounds for the Riemann Integral applied with these bounds gives 0β€β«vbβf(t)dt, and if v=b then applying the additivity lemma to the triple aβ€bβ€b gives β«abβf=β«abβf+β«bbβf, whence β«bbβf=0.
Step 4: the middle piece is strictly positive. By Step 1 we have u<v and Ξ΅β€f(t) for every tβ[u,v], and f(t)β€M there by Step 0; so clause 2 of Uniform Partitions and Order Bounds for the Riemann Integral applied with the bounds m=Ξ΅ and M gives
Ξ΅(vβu)β€β«uvβf(t)dt.
Since 0<Ξ΅ and 0<vβu, the product Ξ΅(vβu) is positive by Elementary Order Arithmetic in an Ordered Field.
Step 5: the contradiction. Combining Steps 2, 3 and 4,
0=β«abβf(t)dtΒ β₯Β 0+Ξ΅(vβu)+0=Ξ΅(vβu)>0,
so 0<0, which is impossible.
Therefore there is no x0ββ[a,b] with 0<f(x0β). Since the order of R is total, every xβ[a,b] satisfies f(x)β€0; combined with the hypothesis 0β€f(x) this gives f(x)=0 for every xβ[a,b].