I believe that a piecewise smooth extremum would have to satisfy the Weierstrass-Erdmann corner conditionsWeierstrass-Erdmann corner conditions. 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 herehere).