For shelving, strength of the wood is important because a weak shelf will bow in the middle under the weight of the books. Avoid this by using wood at least 3/4 inches thick; which provides a sufficient degree of strength to hold up books without noticeable bowing, regardless of the particular kind of solid wood used.
The material used for the shelf will affect how thick the wood needs to be. Oak is a strong and hard material to use, as it will produce a bookcase that looks good even when it is not painted.
Oak’s drawback is its expense. Birch and maple are also excellent choices for bookcases that will be painted or varnished.
When using low-grade materials such as plywood, any thickness of wood will not support books without bending. Place block supports in the center beneath the shelves, to provide extra support.
With this added support, shelves can still be 3/4 inches thick without risk of bowing under the weight of books, otherwise the shelf will eventually buckle.
The frame of a bookcase should be thicker than the shelves it supports. This allows for strength and stability of the bookcase.
Either cut the wood to at least 1 1/2 inches thick, or consider simply gluing two pieces of wood together to form the sides of the frame. The advantage of doubt sheeting is that the inner sheet can be cut into smaller pieces, allowing the shelves to fit into the frame itself.