The Intermediate Value Theorem states that, for a continuous function $f:[a,b]\to \mathbb{R}$, if $f(a)<d<f(b)$, then there exists a $c\in (a,b)$ such that $f(c)=d.$

I wonder if I change the hypothesis of $f(a)<d<f(b)$ to $f(a)>d>f(b)$, the result still holds. I believe so, since $f$ assumes a fixed point $f(x)=x$ in $[a,b]$, so we would have $c=d$, although I'm not completely sure.

I need this result in order to prove the set $X=\{x\in [a,b]\phantom{\rule{thinmathspace}{0ex}}s.t.\phantom{\rule{thinmathspace}{0ex}}f|[a,x]\phantom{\rule{thinmathspace}{0ex}}\text{is bounded}\}$, with a continuous $f$, is not empty.