# Extreme value theorem - condition on continuity for boundedness

According to my math professor, the extreme value theorem is stated as: If $f: [a,b] \to \mathbb{R}$ is continuous then $f$ is bounded, and the maxima and minima are obtained for some $x$ belonging to the domain.

My intuition tells me that the condition on continuity is redundant, and even a function which is not continuous over $[a,b]$ is bounded. Is it not true that any function which is defined for all values in a given closed interval should be bounded? I am unable to think of an example of a function which is defined on a closed interval, but not bounded.

For example, let $f:[0,1] \to \mathbb R$, $f(x) = 1/x$ if $x\neq 0$ and $f(0) = 0$. This is unbounded, and is not continuous at $0$.
No. Take $f:[0,1] \to \mathbb{R}$ by $$f(x) = \begin{cases} n &: x = 1/n \\ 0 &: \text{ otherwise } \end{cases}$$