Let $f$ be continuous and differentiable for $x$ in $[a,b]$ Let $f(x)$ be continuous and differentiable on 
$[a,b]$. Show that if $f'(x)\leq 0$ for $x\in [a,\eta)$ and $f'(x)\geq 0$ for $x\in (\eta,b]$, then $f$ never takes a value smaller than $f(\eta)$.
$\textbf{First approach:}$ Since  $f'(x)\leq 0$ for $x\in [a,\eta)$, then $f$ is decreasing on this interval. On the other hand, $f'(x)\geq 0$ for $x\in (\eta,b]$, then $f$ is increasing on this interval. According to this, $f(\eta)$ attains a minimum at $\eta$, and I just need to verify that $f'(\eta)=0$.\
$\textbf{Second approach:}$ Suppose that there exist $\eta_{0}$ such that $f(\eta_{0})< f(\eta)$ and continue to get a contradiction. 
What approach should I follow? 

Since $f$ is decreasing in $[a,\eta)$ and continuous it follows that $f(x) \geq f(\eta)$ in this interval. Similarly, $f(x) \geq f(\eta)$ in $[\eta,b]$ also. Hence $f(x) \geq f(\eta)$ for all $x$ which shows that we cannot have $f(x) <f(\eta)$ at any point. 
[To see that $f(x) \geq f(\eta)$ for $x$ in $[a, \eta]$ note that $f(x) \geq f(\eta -\frac 1 n)$ (for $n$ so large that $\eta -\frac 1 n \in [a,\eta)$). Then let $n \to \infty$]. 
