Duality in Optimization and Variational Inequalities