Yup, replace it. A helmet is a shock absorber, the styrofoam is compressed during the collision. Once it's compressed, it can no longer absorb shocks. A helmet needs to be replaced after a crash. The damage is not even necessarily visible on the outside.