Nothing ruins a white shirt faster or makes an otherwise smart outfit look sloppier than yellowing around the armpits. Pit stains are, to put it theatrically, a pox upon all our houses. To attack them, take a three-pronged approach: Change what you put under your arms, try to minimize perspiration, and learn how to wash yellowed shirts back to their original white.
The first thing to know is that the coloration associated with pit stains has less to do with sweating and more to do with what you're putting under your arms. Traces of aluminum in many of today's antiperspirants may keep your underarms dry, but when sweat marinates at an elevated heat for a prolonged time, it turns yellowish and brutalizes your shirts.
To eliminate yellowing, stop the problem at the source, say goodbye to antiperspirants and switch over to old-fashioned deodorant, preferably an all-natural one. Sam's makes a good one, as does Malin + Goetz. Unless you're a problematic sweater (in which case you should consider getting professional help), any standard deodorant should be fine.
But if you're kicking the antiperspirant habit in order to go easier on your clothes, you might need a little help controlling sweat. The easiest way to do this is by limiting caffeine intake. Caffeine is a stimulant on your central nervous system. It might help you get out of the house on time every morning, but it also kicks all of your sweat glands into overdrive. In the warmer months, when you're naturally prone to sweat just a bit more, try to limit caffeine intake so you're comfortable wearing just a deodorant, not an antiperspirant.
If you've ever tried to clean a pit stain out of your shirts, you know that classic laundering, even to the garment's instructions, won't really work. The problem is that antiperspirants cake up over time on the fabric; being a hydrophobic compound, it repels water during the rinse cycle. To combat this, use an old toothbrush and a little bit of liquid laundry detergent, and scrub away the stains.
And that's how you go from white to yellow and back again.