Breakdown of continuum mechanics for nanometre-wavelength rippling of graphene