let f(x) be a continuous and differentiable function on the interval $[a,b]$ to $\mathbb{R}$.
- show that $|f|$ has a maximum at a point $x$ satisfying $f^{\prime}(x)=0$, $x=a$, or $x=b$.
My proof:
note that :
- If $f$ is continuous in the closed and bounded interval [a,b], then $f$ must attain a maximum and a minimum
- If $f(x)$ is a continuous function on a closed interval $[a,b]$, then $f$ always has an absolute maximum and an absolute minimum value on $[a, b]$.
Reference :

I think what they meant to say is "show that $|f|$ has a maximum at a point $x$ satisfying $f^{\prime}(x)=0$, $x=a$, or $x=b$."
Hint: As you pointed out, a maximum of $|f|$ is attained on $[a,b]$. If that maximum is on the boundary, we are done. Otherwise, let $x\in(a,b)$ be that maximum. Note that $x$ is a maximum or minimum of $f$ (why?), from which the result follows.