I was needing to reinforce 5 shelf bookcase that was leaning to one side and had sagging bookshelves. I had read about using 1/8 inch plywood/hardboard, but it seems to me that it would be too flimsy. Wouldn’t it need 1/4 inch material?It is leaning over a few inches based on how unlevel bottom set of doors are.
The backing doesn't need to be very thick to prevent the deformation (parallelogramming) you are seeing because it works by tension rather than compression. The edges of heavier backing would show more and require molding to cover them. Lay the shelf unit down on its front, square it up and use small brads or fine finish nails to attach the thin backing around the edges--top, bottom and both sides.
Sagging shelves are another matter. Are these shelves adjustable, say with pegs in holes? If so, you would have to stiffen the shelves on the front.
If the shelves are fixed to the sides, you would tack the backing to the individual shelves, this would help, but the front edges of the shelves might need stiffeners attached to the bottoms along the front edge, if the shelves are not made of stiff wood. These stiffeners would interfere with getting books in and out and limit the size of books that could be shelved. You could put stiffeners on one or two shelves and put the heavier books there.
The back will hold the case square by virtue of compression AND tension. All you need to do is attach a single wood strip diagonally to opposite corners (compression and tension). That is all. Or instead, attach two wires, each diagonally to opposite corners to form an X (tension only). Or cut open a large garbage bag and attach it as a full back (tension only).
If your shelves are sagging, there is really nothing you can do other than turn the bookcase (or shelves) upside down and use it that way until they are flat again. At that point you can turn the book case right side up, and attach front and rear struts, but that will only slow the rate of sag.
Or keep it upside down and wait until they sag in that orientation, then turn the book case rightside up and attach front and rear struts so that the shelves have a built in bow, which will slowly decrease and then will stop at some point. If you build in the correct bow for the weight, the sag will stop when the shelves are flat.