Why does my toothache?

You may have a dental cavity or advanced gum disease.  The first sign of decay may be the pain you feel when you eat something sweet, very cold or very hot.  If the pulp-the inside of the tooth that has tissue and nerves-has become irritated, this also can cause pain in your tooth.
Source: Academy of General Dentistry