Possible Problem
If the discomfort lasts only moments, sensitivity to hot and cold foods generally does not signal a problem. The sensitivity may be caused by a loose filling or by minimal gum recession which exposes small areas of the root surface.
What To Do
Try using toothpastes made for sensitive teeth. Brush up and down with a soft brush; brushing sideways wears away exposed root surfaces. If this is unsuccessful, see your dentist.