A fish is not a mammal. Mammals are animals that are warm-blooded, breathe air, possess hair and give birth to live young that they feed milk from mammary glands. Fish are cold-blooded, extract oxygen from water, have scales and lay eggs.
Mammals and fish are both vertebrates, possessing a bony backbone. True fishes are part of the vertebrate superclass Osteichthyes, which includes all bony fish. Mammals, on the other hand, are members of the superclass Tetrapoda, including all four-limbed vertebrates, such reptiles, birds and amphibians.
The most recent common ancestor of tetrapods and bony fish is the lobe-finned fish, known scientifically as Sarcopterygii. The coelacanths and lungfish are the only two other existing members of this class.