Connectedness and Necessary Conditions for an Extremum