How do I know if I have a cavity if my teeth don't hurt?

Cavities are diagnosed through the use of X-rays and the dentist's clinical exam looking for any darkened areas of the tooth while feeling for soft tooth structure.  Cavities typically do not hurt when they are in the beginning stages and often only begin to hurt once they've progressed past the point of being fixed with a simple filling.  It is always best to find cavities when they are small to reduce the risk of additional treatment being necessary to fix the tooth.