Let $a,b \in R$, such that $a \lt b$, $f: [a,b] \rightarrow R$ (continuous). Prove that if f is monotonic in (a,b) then it's also monotonic in [a,b] Let a,b $\in R$, such that $a \lt b$, and $f: [a,b] \rightarrow R$ (continuous). Prove that if f is monotonic  in (a,b) then it's also monotonic in [a,b].
Could the intermediate value theorem be used to prove this?
 A: Suppose $f$ is monotonically increasing. Then for any $c \in (a,b)$, 
$$f(c)\leq f((1/n) c +(1-1/n)b),$$
for $n\geq 1$ by monotonicity. Taking the limit as $n \to \infty$ and using the continuity of $f$ gives
$$f(c) \leq f(b).$$
Since this holds for all $c \in (a,b)$, $f$ is monotone on $(a,b]$. Similar logic can be used to show that $f(a)\leq f(c)$ for all $c \in (a,b)$, so $f$ is monotonically increasing on $[a,b]$. 
A: 
Could the intermediate value theorem be used to prove this?

That is possible. Assume that $f$ is monotonically increasing in $(a, b)$ but not
in $[a, b]$. Then


*

*$f(a) > f(c)$ for some  $c \in (a, b),$ or

*$f(c) > f(b)$ for some  $c \in (a, b).$


Without loss of generality assume the latter. Then
$$
  f(c) > \frac {f(c)+f(b)}2 > f(b)
$$
and according to the  intermediate value theorem,
$$
 f(d) = \frac {f(c)+f(b)}2 \text{ for some } d \in (c, b)
$$
which is a contradiction to $f$ being increasing on $[c, d] \subset (a, b)$.
A: Like Richard said, continuity of f on $[a,b]$ is the important property we can use.
First observe that $\lim \limits_{\epsilon \rightarrow 0}f(a+\epsilon)=f(a)$ and $\lim \limits_{\epsilon \rightarrow 0}f(b-\epsilon)=f(b)$. 
Suppose $f$ is increasing on $(a,b)$, then for all $\epsilon \in (0, \frac{b-a}{2})$, $f$ is also increasing on $(a+\epsilon, b- \epsilon)$. Thus for all x, y in $(a+\epsilon, b- \epsilon)$, if $x<y$, then: 
$$f(a+\epsilon)<f(x)<f(y)<f(b-\epsilon)$$
The result follows from our first observation. There are many ways to show this, but continuity of $f$ on $[a,b]$ is key.Best wishes.    
A: It is possible to establish very easily the following facts:


*

*If $f$ is monotonic in $(a, b)$ then $f$ is monotonic in $[a, b]$.

*If $f$ is strictly monotonic in $(a, b)$ then $f$ is strictly monotonic in $[a, b]$.


Here we use provide proof for both the results for functions which are monotonically increasing. The case of decreasing functions is obtained by reversing all the inequalities involved.
So let $f$ be increasing on $(a, b)$ which means that if $x, y \in (a, b)$ with $x < y$ then $f(x)\leq f(y)$. We need to prove that if $a < x < b$ then $f(a) \leq f(x) \leq f(b)$. Let take another number $x'$ such that $a < x' < x$. Then $f(x') \leq f(x)$ and letting $x' \to a^{+}$ we get $f(a) \leq f(x)$ via continuity of $f$. Same way we can prove $f(x)\leq f(b)$. Thus $f$ is increasing on $[a, b]$.
Now let $f$ be strictly increasing on $(a, b)$ so that $x, y \in (a, b)$ with $x < y$ implies $f(x) < f(y)$. Let $a < x < b$ and we prove that $f(a) < f(x) < f(b)$. We choose two number $x, x''$ such that $a < x' < x'' < x$ then we have $$f(x') < f(x'') < f(x)$$ and letting $x' \to a^{+}$ we get $$f(a) \leq f(x'') < f(x)$$ and similarly we can prove that $f(x) < f(b)$. Thus $f$ is strictly increasing on $[a, b]$.
