Bookshelf back reinforcement
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.