Critical points and inflection points