Continuity and derivability of a piece wise f unction Let $f(x)=x^3-9x^2+15x+6$ and 
$$g(x)=
\begin{cases} 
      \min f(t) &\mbox{if } 0\leq t \leq x, 0 \leq x \leq6 \\
      x-18 &\mbox{if }x\geq 6. \\ 
\end{cases}
$$
Then discuss the continuity and derivability of $g(x)$. 
Could someone explain be how to deal with $\min f(t)$ where  $0\leq t \leq x, 0 \leq x \leq6$.

Hint. One has
$$
f(x)=x^3-9x^2+15x+6 \implies f'(x)=3x^2-18x+15=3(x-5)(x-1).
$$ Evaluate $f(1)$ and $f(5)$. Can you take it from here?
