A corrosion inhibitor is a chemical that helps stop metal from getting rusty. It works by forming a thin barrier on the metal surface that stops water and oxygen from getting to the metal, which are the things that cause rust. Corrosion inhibitors are usually added to paint and usually when painting things like cars or ships that are exposed to the elements outside.