As the title indicates, I'd like to prove the following:
If $f:\mathbb R\to\mathbb R$ is a continuous function on $[a,b]$, then $f$ attains its maximum.
Now, I do have a working proof: $[a,b]$ is a connected, compact space, which means that because $f$ is continuous, $f([a,b])$ is compact and connected as well. Therefore, $f([a,b])$ is a closed interval, which means it has both a minimum and, as desired, a maximum.
What I would like, however, is a proof that doesn't require such general or sophisticated framework. In particular, I'd like to know if there's a proof that is understandable to somebody beginning calculus, one that (at the very least) doesn't invoke compactness. Any comments, hints, or solutions are welcome and apreciated.