By Extreme Value Theorem on a Compact Interval, the function f attains a maximum and a minimum on [a,b]. Let xmax,xmin∈[a,b] be points such that f(xmax)≥f(x)≥f(xmin) for all x∈[a,b].
If f(xmax)=f(xmin), then f is constant on [a,b], so f′(x)=0 for every x∈(a,b). In particular, any c∈(a,b) works.
Assume now that f is not constant. Then either f(xmax)>f(a)=f(b) or f(xmin)<f(a)=f(b). In the first case xmax∈(a,b); in the second case xmin∈(a,b). Thus there exists an interior point c∈(a,b) at which f has a local extremum. By Fermat Stationary Point Criterion, we have f′(c)=0.