When I use hot stuff like hair straightener on my hair, my hair begins to smell bad, which is very different from smell produced from burning other things. So what's the gas produced that is responsible for this smell?
Hair is largely (~90%) composed of a protein called keratin, which originates in the hair follicle.
Now, keratin is composed of a variety of amino acids, including the sulfur containing amino acid, cysteine. All these amino acids are joined to each other by chemical bonds called peptide bonds to form these long chains that we call polypeptide chains. In the case of human hair, the polypeptide that we're talking about is keratin. The polypeptide chains are intertwined around each other in a helix shape.
The average composition of normal hair is 45.2 % carbon, 27.9% oxygen, 6.6% hydrogen, 15.1% nitrogen and 5.2% sulfur.
(I got that diagram off of Google Images)
Now, there are a whole bunch of chemical interactions that maintain the secondary and tertiary structures of proteins, such as van der Waals forces, hydrophobic interactions, polypeptide linkages, ionic bonds, etc. But there is, however, one additional chemical interaction in proteins that contain the amino acids cysteine and methionine (both of which contain sulfur) called disulfide linkages. You can see that in the diagram above (it's been marked in yellow, which is fortunately, a very intuitive color when you're dealing with sulfur).
When you burn hair (or skin or nails... anything that has keratin in it for that matter) these disulfide linkages are broken. The sulfur atoms are now free to chemically combine with other elements present in the protein and air, such as oxygen and hydrogen. The volatile sulfur compounds formed as a result is what's responsible for the fetid odor of burning hair.
Quite a few of the "bad smells" we come across everyday are due to some sulfur containing compound or the other. A great example would be the smell of rotten eggs, which can be attributed to a volatile sulfur compound called hydrogen sulfide. Yet another example (as @VonBeche points out in the comments) would be that of tert-butylthiol, which is the odorant that is used to impart the characteristic smell of Liquefied Petroleum Gas (LPG).
Yes, breaking of disulphide bridges is largely responsible for the bad smell. However, I think there is also some additional bad smell coming from ammonia, which is also a part of all amino acids.
Lots of interesting points here. I agree that ammonia would probably be produced in much more minute quantities than nitrogen oxides, but I wouldn't rule out the formation of amines, which are associated with smells like rotting fish.
Degradation started with formation of ammonia and CO2 (from 167 and 197 °C respectively and with maximum evolution at 273 and 287 °C respectively), continues with formation of sulphur-containing inorganic compounds (SCS, SCO, H2S and SO2 at 240, 248, 255 and 253–260 °C respectively) and of water (255 °C). Thiols are formed in two stages (257 and 320 °C) while the evolution of nitriles is maximum around 340 °C and continues up to about 480 °C. Phenol and 4-methylphenol are the most important degradation compounds, formed at 370 and 400 °C respectively. Nitrogen was present mainly in aliphatic/aromatic nitriles, pyrroles, pyridines and amides while sulphur was found mainly as sulphides, thiols, thiazoles and thiophenes. — http://www.sciencedirect.com/science/article/pii/S0165237011000490?via%3Dihub