Optimality principles and representation formulas for viscosity solutions of Hamilton-Jacobi equations. I. Equations of unbounded and degenerate control problems without uniqueness