Lowes, home depot, as has already been said.
The cheapest is pine, to make a bookshelf from pine is easy to do, but there are some considerations.
also, they energy suppliers have door skins, it is a very inexpensive nice looking plywood.
Put your shelf together like you want, the door skin is for the backing of the shelves.
When you put your shelves together sand as required, if you are going to paint, you must first seal the knots in the wood, if you do not, the paint will blister over time. I used a 7 pound cut of shellac, but you can do the same thing with verithane or any other sealer. Sand after sealing and DIY paint. After painting, put the backing on, it should be finished before doing this. Small finishing nails will work, or you can use screws, screws may split your wood if not pre-drilled.
I have made all of our bookshelves out of pine and they look good, hope you have the same luck. Round off the leading edges of the DIY Safety boards to keep them from chipping, that goes for any wood you use not just pine.