How was it discovered that flouride helps stop tooth decay?
There is an interesting historical story of fluoride use in prevention of dental caries.
Interestingly the journey started with a &quot;mysterious disorder-fluorosis.&quot;

In 1909 Dr. McKay (r) persuaded the Colorado State Dental Association to invite Dr. Green Vardiman Black (l), one of the nation's most eminent dental researchers, to attend 1909 convention where McKay's findings were to be presented. The two men began joint research and discovered other areas of the country where brown staining of teeth occurred.

Fluoride research had its beginnings in 1901, when a young dental school graduate named Frederick McKay left the East Coast to open a dental practice in Colorado Springs, Colorado

McKay collected the samples. And, within months, he had the answer and denouement to his 30-year quest: high levels of water-borne fluoride indeed caused the discoloration of tooth enamel.


Dr Dean recalled from reading McKay's and Black's studies on fluorosis that mottled tooth enamel is unusually resistant to decay. Dean wondered whether adding fluoride to drinking water at physically and cosmetically safe levels would help fight tooth decay.


This finding, considering the thousands of participants in the study, amounted to a giant scientific breakthrough that promised to revolutionize dental care, making tooth decay for the first time in history a preventable disease for most people.

These are excerpts from the article
Another reference
In 1802, Sir James Chrichton Browne suggested the probable cause of dental caries as a change in bread, which did not have bran or husky part of wheat containing fluorine.
Now your next question on fluoride stopping the tooth decay.
So yes apart from preventing tooth decay, research has found that fluorides like silver diamine fluoride can be treatment of choice for dental caries.

The silver component provides an anti-bacterial effect while the fluoride promotes remineralization of tooth structure.

I hope I have answered your question :)