The maximum/minimum of a function are the points where the first derivative (the gradient) of the function is zero.
So with a function of the form y=f(x), you must take the derivative (dy/dx) and set your result equal to zero. This equation must then be solved for x, to find the x value(s) for which the function is a maximum or minimum.
To determine which values are maxima and which are minima, you must take the second derivative of the function (this means differentiating the original function twice) and substitute each of the x-values found above into this equation in turn. The values which give a positive output for the second derivative are minimum points and the values which give a negative output for the seond derivative are maximum points.