I have a problem understanding the last part of the usual proof of the extreme value theorem (found for example here: Extreme Value Theorem proof help)
It is this part that I have trouble understanding:
Since g(x)=1\M−f(x)≤K is equivalent to f(x)≤M−1/K, we have contradicted the fact that M was assumed to be the least upper bound of f on [a,b]. Hence, there must be a balue c∈[a,b] such that f(c)=M.
Why is it that we are sure that there exist a c on the interval where the maximum is attained? I mean, don't we just know that the new sup is M-1/K, but that it necessarily will not attain a max on the interval? Or do we have to assume that the function g that we create attains a maximum for f to attain a maximum?