I decided to pull the carpet off one of my stairs to see what was hiding under there. Ideally I'd like to paint them (I don't think they are real wood) but there are gaps on both sides...how do I go about filling these gaps? There is already a skirt on both sides of the stairs as well. I'd say the gap on the right is a little over 1/4 inch and the one on the left is just about 1/4 inch.
Small pieces of trim on each tread and each riser would do nicely to hide those gaps. They'll be pretty fiddly to get a nice joint where horizontal meets vertical - you'll want cope those joints so they stay nice looking and don't open up over time.
Based on this picture, I would agree that they're not "real" wood. Where that paint has come off, it looks like MDF. Even with paint on them, I'm not sure how well they'll take the daily abuse of being walked on. The carpet protected them from wear, but the paint may not take the abuse as well. If you're going to remove the carpeting, you'll probably want to replace the treads with solid wood. The risers should be OK remaining MDF, if that's what they're made of.
Also, be aware that paint can be very slippery, especially glossy paints. You'll want to look at something that's specifically designed for floors, or something that you can add some fine sand or grit to in order to give traction. You don't want increase the chances of someone slipping on the stairs, tumbling down, and landing on that tile at the bottom.
Those gaps are there by design. Staircases move, and you don't want tight-fitting treads and risers or you'll have a symphony of squeaks and creaks. For that reason I would paint them as they are. Painted particle board isn't going to look tremendously luxurious anyway, so those small gaps aren't likely to destroy your aesthetic.
Your treads are particle board or fiberboard, both of which are fairly soft. I agree with FreeMan about them being less durable. Use a heavy floor paint or polyurethane to protect them.