Optimality Conditions and Duality Involving Arcwise Connected and Generalized Arcwise Connected Functions