Fluoride in drinking water has no effect on IQ or brain function, long-term study shows
(twin-cities.umn.edu)
The study suggests no change in IQ values, not no change when it comes to protecting your teeth. To copy an example from a previous comment:
IQ only measures the ability to solve problems and pattern-match. And I would assume IQ tests are taken after cavities are dealt with. It’s the same thing as if you tried to give an IQ test to someone who, in the past, has had a bacterial infection. Then, when the person is perfectly healthy, you give them an IQ test once, then some antibiotics, then another IQ test giving the same result as the first. You would not conclude that antibiotics are ineffective and should be banned!