Onions, with their many layers of skin, seem like they never go bad. However, just like any other vegetable, onions are perishable. Even if stored under the best conditions, they will start to go bad after about two or three months. It doesn't matter whether they are stored in the refrigerator or the pantry. Onions that are stored near potatoes will spoil even faster. The chemicals that both onions and potatoes emit react in a way that causes both vegetables to spoil. You'll be able to tell when the onions are spoiled by the way the smell, look and feel.
Look at the onions. Fresh onions look clean and firm. The onion should not be sprouting or have any dark spots or signs of decay. Avoid onions that look like they have any moisture on the neck.
Feel the onions. Onions should be firm and smooth to the touch. Any onions that have soft spots or feel less than firm should be discarded.
Smell the onions. Decaying onions will give off distinct foul odor and should be discarded immediately.