Let $f$ be a bounded continuous function on $[a,b]$. Prove $f$ attains its max and min on $[a,b]$; there exists $x_0$, $y_0 \in [a,b]$ such that $f(x_0) \leq f(x) \leq f(y_0)$ for all $x \in [a,b]$.
Proof: I already got the part of the maximum. In other words that $f$ attains its max at $M = sup\{f(x)\}$. To show that $f$ attains its min, Can I just say that since $-f$ attains its maximum at $sup\{-f\}$, then since $sup(-S) = -inf(S)$, $f$ attains min at $inf\{f\}$ ?
Is this correct? Do you guys have better ideas?
thanks