The structure in fish that performs the same function as lungs in mammals is the gills.
* Lungs: In mammals, lungs take in oxygen from the air and release carbon dioxide.
* Gills: In fish, gills extract oxygen dissolved in water and release carbon dioxide.
While the medium they work in is different (air vs. water), the fundamental function of both lungs and gills is gas exchange.