What you use will depend on how you use it and the length of span. Two things that should never be used, IMHO, are MDF and particle board, including PB core veneered panels. MDF and PB do not have enough resistance to bending unless it spans no more than 24" to 32", even then I wouldn't use it.

Plywood is acceptable and commonly used for shelving because it is less expensive than solid wood, and you can more easily make any depth shelf you want. The more plys, the stronger the plywood.

Pine is perfectly suitable for shelving, as are other soft wood types, what you choose here will depend on the look and finish you're going for. The worst thing about pine is the amount of sap in it that hampers staining and finishing.

The easiest way to increase the strength of any shelf is to put a nosing on it, which is typically 3/4" x 1-1/2" x shelf length. Make sure you account for the width of the nosing in your total shelf width or you'll have shelves that are deeper than your cabinet.

When building shelving cabinets, the best rule of thumb is to not exceed 36" in width on the shelves, no matter what type of material you're using, this is about the maximum width you can go without the risk of sagging shelves. If you're going to load the shelves completely with books, use shorter lengths, if you're going to have lots of decorations and open shelf space, then you can go slightly longer.