Answer
The maximum of $f(x)$ is $ f( 8)=17 $ and the minimum is $f( 3)=2$
Work Step by Step
Given $$f(x)=|x-1|+|2 x-6| \text { in }[0,8]$$
Rewrite $f(x)$
$$f(x)=|x-1|+|2 x-6|=\left\{\begin{array}{ll}
{7-3 x,} & {x<1} \\
{5-x,} & {1 \leq x<3} \\
{3 x-7,} & {x \geq 3}
\end{array}\right.$$
Find the derivative
$$f'(x) =\left\{\begin{array}{ll}
{-3 ,} & {x<1} \\
{-1,} & {1 \leq x<3} \\
{3 ,} & {x \geq 3}
\end{array}\right.$$
There is no $x$ such that $f'(x)= 0$, but $f(x)$ has critical points at $ x=1$ and $x=3$.
We test the values at the critical points and end points:
\begin{align*}
f(0)&=7\\
f(1)&=4 \\
f(3)&=2\\
f(8)&=17
\end{align*}
Then the maximum of $f(x)$ is $ f( 8)=17 $ and the minimum is $f( 3)=2$.