Unlike your head, helmets are not made to last forever. When your lid takes a hard hit, the styrofoam layer between the comfort padding and outer shell crushes, as it absorbs the impact. However, this material does not bounce back, leaving a void area in the helmet that can no longer absorb impacts, leaving your cabbage vulnerable to injury. In some cases, this happens with very little if any visible damage to the outer shell, so the helmet still looks perfectly fine.
Now, tossing an expensive helmet that looks fine can be a bitter pill to swallow, but sometimes the helmet sacraficed itself for you and this is exactly what you should do. However, if you're not sure, there are a couple of things that you can do:
1. Before you buy a helmet, check with the manufacturer or dealer to see if they have a safety inspection process that you can live with. Many of the top manufacturers will gladly inspect your lid for safety. This usually takes a few weeks, but it might be worth the wait if you have more time than money and it is definately the wise thing to do if you're not sure if your helmet's ability to protect has been compromised.
2. Install a Shock Spot-R. It's a stick-on device that has a sensor that turns red when your lid has taken a hit that is big enough to warrant at least an inspection, if not replacement. Remember, it costs time/money to ship back your helmet for inspection, so something like this can pay for itself quickly, by avoiding sending your helmet in for inspection when it has not be compromised.
Also, make sure you read the manufacturers care instructions carefully. Some chemicals can weaken a helmet's shell, depending upon the material. Also, just about everything seems to break down over time due to UV exposure, so extend the life of your helmet by storing it in a cool, dry place inside a helmet bag.
Additional info concerning helmet safety, testing and standards, refer to: