These days it seems that just about everything is bad for you, so when you find research that suggests that something you enjoy consuming may have health benefits, it is definitely worth investigating.
While coffee and your teeth may have a somewhat dubious relationship because of coffee's tendency to stain the teeth, there is research that shows that caffeinated coffee does in fact have some very real benefits.
Research in 2012 has shown that people who drink coffee on a daily basis have a reduced risk of mouth and throat cancer. More specifically, it was found that consuming 4 or more cups of caffeinated coffee a day resulted in a 49% lower risk of death due to oral/pharyngeal cancer.*
Studies were also done with decaffeinated coffee and also with tea. However, the results were not as conclusive, possibly because decaffeinated coffee is consumed far less and in much smaller quantities. Caffeinated coffee, however was the winner in this research.
The overall consensus is that with coffee being one of the most consumed beverages on the planet, it makes sense to research benefits (and drawbacks) more thoroughly. Researchers study coffee and its effects with great interest for this reason.
As mentioned at the beginning of this post, although coffee may indeed have numerous health benefits, you should remember that any acidic beverages can ultimately damage your teeth. Coffee, tea, wine and grape juice are primary causes of tooth staining. Many other beverages that contain acids, such as citrus juices, can eat away at the enamel of your teeth. Rinsing and brushing directly after consuming these beverages is a good idea. If you can't brush right away, then you should drink a glass of water afterwards, to prevent the beverage from just sitting on your teeth.
You will notice that soda did not make it on the list. And as beverages go, it is not at all good for your teeth. Always be sure you brush your teeth after drinking all beverages!
* Coffee, Tea, and Fatal Oral/Pharyngeal Cancer in a Large Prospective U.S. Cohort, Am. J. Epidemiol. (2012)