Tooth pain and general sensitivity can be extremely situational. Your teeth may appear to be in perfect condition, both in appearance and sensation—until you eat or drink something hot or cold. The temperature of what you consume triggers a usually dormant sensitivity, and your teeth hurt. Perhaps it's only temporary for now, but this type of sensitivity tends to get worse.
The Outer Layer
Temperature-related tooth pain is often related to the outer layer of your teeth—an outer layer that's not as intact as it used to be. This outer layer is made of dental enamel, which is strikingly strong and protects the inner layers of your teeth (the hard dentin beneath the enamel, and the tooth's nerve at the center). Strikingly strong it may be, but indestructible, it's not.
Corrodes and Thins
When enamel corrodes and thins, the dentin beneath is uncovered. But dentin has a labyrinth of microscopic canals running throughout its structure—all generally leading from its external surface (usually protected by dental enamel) to the nerve in the heart of the tooth. This means that exposed dentin allows the tooth's nerve to experience the especially hot or cold foods and beverages you consume (via those canals)—and to be irritated by them.
This irritation is the sensitivity you're dealing with. As mentioned, it will get worse. Your sensitivity will increase as your enamel continues to deteriorate. This also allows bacteria to penetrate the nerve, which can become inflamed and even infected. So your dental enamel needs to be restored. But when the enamel is gone, it's gone forever.
Remineralization and Fortification
Dental enamel can't be regrown. You'll need to see a dentist for a synthetic replacement. This can take different forms. When the enamel is thin, yet still mostly intact, your dentist may want to intensely remineralize the tooth. This involves a fluoride treatment (or a series of them), with mineral residue from the treatment remaining on the tooth, integrating with its structure, and fortifying your thin enamel.
More Extreme Sensitivity
When sensitivity is more extreme, simple remineralization may be inadequate. Your dentist can instead replace the missing enamel by bonding your teeth. This is the application of a thin layer of tooth-colored resin, which becomes the new outer layer of the tooth. It looks perfectly natural and seals the dentin and the tooth's nerve, halting the decline of your enamel and preventing further sensitivity.
A sharp pain when eating and drinking hot and cold foods is your body's way of suggesting that your dental enamel might not be in the best shape. Remember that the issue won't correct itself, and you'll want to visit a dentist familiar with treating tooth pain.