Peter Rombough, a biologist at Brandon University in Canada, has conducted a study on the functions of fish gills. He concludes that although gills may allow a fish to breathe, that might not be the original reason why they evolved:
Link via reddit | Photo: US Department of the Interior
In order to keep from shriveling like your fingers in the bathtub, fish must constantly exchange ions, such as sodium and potassium, with the water. Larval fish can exchange ions through their skin, and early fish likely used rudimentary gill structures known as branchial baskets. But when the salinity of the water changes rapidly--as happened when fish invaded freshwater habitats--fish would have needed a much more efficient way of exchanging ions with their environment. That means large, complex gills.
Link via reddit | Photo: US Department of the Interior