Given a continuous function f defined on a compact set A, to show that f(A) is nonempty, the author of my textbook simply says that "every continuous function defined on a compact set reaches a maximum." Can anyone explain it in more detail? Why is that? Or how should I prove its nonempty-valuedness?