Caustics of nonlinear waves