Answer
\[f'\left( x \right) = \left\{ {\begin{array}{*{20}{c}}
{2,{\text{ }}x \leqslant 1} \\
{ - 1,{\text{ }}x > 1}
\end{array}} \right.\]
Work Step by Step
$$\eqalign{
& {\text{From the graph we have for }}x \leqslant 1{\text{ the points }}\left( {1,5} \right){\text{ and }}\left( {0,3} \right) \cr
& {\text{The equation of the line is given by}} \cr
& y - {y_1} = m\left( {x - {x_1}} \right) \cr
& {\text{Using the points }}\left( {1,5} \right){\text{ and }}\left( {0,3} \right){\text{ we obtain:}} \cr
& m = \frac{{{y_2} - {y_1}}}{{{x_2} - {x_1}}} \cr
& m = \frac{{3 - 5}}{{0 - 1}} \cr
& m = 2 \cr
& {\text{The equation of the line is}} \cr
& y - 3 = 2\left( {x - 0} \right) \cr
& y - 3 = 2x \cr
& y = 2x + 3 \cr
& \cr
& {\text{From the graph we have for }}x > 1{\text{ the points }}\left( {1,5} \right){\text{ and }}\left( {2,4} \right) \cr
& {\text{The equation of the line is given by}} \cr
& y - {y_1} = m\left( {x - {x_1}} \right) \cr
& {\text{Using the points }}\left( {1,5} \right){\text{ and }}\left( {2,4} \right){\text{ we obtain:}} \cr
& m = \frac{{{y_2} - {y_1}}}{{{x_2} - {x_1}}} \cr
& m = \frac{{4 - 5}}{{2 - 1}} \cr
& m = - 1 \cr
& {\text{The equation of the line is}} \cr
& y - 4 = - \left( {x - 2} \right) \cr
& y - 4 = - x + 2 \cr
& y = - x + 6 \cr
& \cr
& {\text{The function }}y = f\left( x \right){\text{ can be written as}} \cr} $$
\[\begin{gathered}
f\left( x \right) = \left\{ {\begin{array}{*{20}{c}}
{2x + 3,{\text{ }}x \leqslant 1} \\
{ - x + 6,{\text{ }}x > 1}
\end{array}} \right. \hfill \\
{\text{Differentiating we obtain}} \hfill \\
f'\left( x \right) = \left\{ {\begin{array}{*{20}{c}}
{2,{\text{ }}x \leqslant 1} \\
{ - 1,{\text{ }}x > 1}
\end{array}} \right. \hfill \\
\end{gathered} \]
\[{\text{The graph of }}f'\left( x \right){\text{ is shown below}}\]