Local Extremes of Functions