In these you need to check the endpoints and where f'=0.

That's rather straight forward.

So in (1) f'=0 at x=0.

So you just need to compare f(0), f(-5) and f(2).

But clearly, since this is an 'upside down' parabola the max occurs at x=0 and that value is 4.

The min occurs at the endpoints, just comapre those two.