Let's give a quick proof. I'll be using the Bolzano-Weierstrass theorem, as well as the fact that continuous functions preserve limits.

First, boundedness. If f weren't bounded above, then for any natural number n we could always find a number x_{n }in the interval with f(x_{n})>n. By the Bolzano Weierstrass theorem, a subsequence of x_{n} converges to some number x in the closed bounded interval. By construction, f(x_{n}) tends to infinity, and so so does the subsequence in question. But since continuous functions preserve limits, this is a contradiction (we'd have f(x)=infinity). Similarly for boundedness below.

So, f is bounded. Let M=sup f, so f(x) is at most M for all x in the interval. On the other hand, because M is the least upper bound, any number less than M will be exceeded by some value of f. So, for all n, there exists x_{n} with M-1/n<f(x_{n})<=M. Again by the Bolzano Weierstrass theorem, some subsequence of x_{n} converges to x, and by design, f(x_{n}) converges to M, and then so does the subsequence in question. Since continuous functions preserve limits, we have f(x)=M. Again, lower bounds are similar.