I believe that a piecewise smooth extremum would have to satisfy the [Weierstrass-Erdmann corner conditions][1]. If these conditions ensure that the extremum is in fact $C^1$, then it solves the Euler-Lagrange equations everywhere. At this point one can appeal to the regularity of solutions of ODEs, which can easily get you $C^2$ or even higher smoothness, depending on the regularity of the functional form of the ODE itself.

For more generality, look up the sufficient conditions for a *strong* variational extremum (starting at Weak and Strong Extrema [here][2]).


  [1]: https://encyclopediaofmath.org/wiki/Weierstrass-Erdmann_corner_conditions
  [2]: https://encyclopediaofmath.org/wiki/Variational_calculus#Weak_and_strong_extrema.