The carbon dioxide breathed out is a by-product of the process of cell respiration.
What we inhale is far from pure oxygen, but roughly by volume 78 per cent nitrogen, 21 per cent oxygen, 0.965 per cent argon and 0.04 per cent carbon dioxide (plus some helium, water and other gases). The permanent gases in air we exhale are roughly 78 per cent nitrogen, 15 to 18 per cent oxygen (we retain only a small amount), 4 to 5 per cent carbon dioxide and 0.96 per cent argon.