The first derivative is f'(x)=3x^2-2x-40. This can be factored as f'(x)=3x^2-2x-40=(3x+10)(x-4). Setting this equal to zero and solving for x gives two critical points for f at x=-10/3 and x=4.
You can check that f' changes sign from positive to negative as x increases through x=-10/3 and negative to positive as x increases through x=4 (note that f' is a continuous function and that, for instance, f'(-4)=48+8-40=16>0, f'(0)=-40<0, and f'(5)=75-10-40=25>0).
Therefore, the First Derivative Test implies that f has a local maximum at x=-10/3 and a local minimum at x=4.
The local maximum value (output) is f(-10/3)=-1000/27-100/9+400/3+8=2516/27 and the local minimum value (output) is f(4)=64-16-160+8=-104.