A differentiable function f(x) will have a local maximum at x = c if -
f’(c) = 0 , f’(c-h) > 0 & f’(c+h) < 0
If a function has local maximum at x = c, then the derivative at that point will be zero. This is clear from the figure below. At all the points where the function has an extremum, the tangent becomes parallel to x-axis. We can say that the derivative f’(x) also becomes zero because the slope of such tangents will be zero.
Now, if we look at the graph, we can see that the slope of the tangents just before a local maximum is positive and just after local maximum it is negative.
i.e. f’(c-h) > 0
& f’(c+h) < 0
Then we can say that f(x) has a local maximum at x = c.