What is the 50mm f1.8 good for?

I have a nikon d3100 and i'm debating between a couple of lences to buy, i heard the 50mm is good for portraits but for what else?

It would be useful for any shots where there's a cluttered background (Wide aperture) … Shooting through a chain link fence, and I've used mine for product shots although mine is the f/1.4 version.
In fact a 50mm prime on a APS-C sensor camera like the D3100 is good for anything that requires a mild telephoto effect. You can also make very nice clichéd christmas cards using this lens!

It's a great lens. On the D3100 it is a good portrait lens. On a camera like the D700 which is a full frame camera a 50mm prime lens is a good general purpose lens. People who only use prime lenses will generally have a 50mm on their camera as the ready to go lens.

The Nikon AF 50mm f1.8 lens is good for low-light situations where you don't want to use the flash. Its also good for portraits.
Unfortunately, because Nikon didn't put a focusing motor in the camera body and since the AF 50mm f1.8 lens doesn't have a focusing motor it won't auto focus on your D3100. If you want a 50mm lens that will auto focus on your D3100 instead of spending a mere $120.00 on the AF 50mm f1.8 you'll have to spend $435.00 and buy the Nikon AF-S 50mm f1.4 lens.

It's good for low light (not too low, of course)

While the 50mm f/1.8 is good for a lot of things (see ), it won't autofocus on your camera. It's an affordable gem of a lens with a lot of versatility and really good in low-light conditions (without flash), but you'll have to manually focus every time you compose a shot. It may be frustrating to you, but you can go to the store and try it out… Get a hands-on experience. You'd have to spend nearly 4x that to get the AF-S version (which also has a wider aperture) so you can autofocus with it.