Discontinuous solutions in the calculus of variations