The gas mask as we know today evolved from inventions over time to time used by deep marine divers, firefighters and armies. A popular misconception about the gas mask was that it was invented by Garrett A. Morgan in 1914. Morgan's invention didn't resemble today's mask and was simply a hood with a breathing tube that hung to the floor. So a firefighter could draw breath from the lower, cleaner layers of air while fighting a fire.
It was later adapted for mine rescues where the tubes could be manipulated to avoid flooded mine tunnels or gas filled pockets. The question of who invented the gasoline mask is not easily answered. In 1848, a US patent was issued for one Lewis P. Haslett for devices built to exclude smoke and other solid particles from manufacturing air and gas masks.
Image Source: Google
In 1854 Scottish chemist John Stenhouse created a simple mask that uses charcoal to filter harmful gases. In 1871 and 1874 two British inventors produced devices that remove solid particles and harmful gases from the air using a full hood above the head and tube connected to a slightly pressurized oxygen tube. In 1914 Garrett Morgan found a device that gained a national advantage when used to save 32 workers trapped far below the surface in the cave of flooding mining.