Assume the shopkeeper buys x number of books for Rs 80.
Cost per book = 80/x
80/x -80/(x+4) = 1
80 (x+4 -x) /x(x+4) = 1
80x4 = x(x+4)
320 = x2 + 4x
x2 + 4x - 320 =0
x2 + 20x -16x- 320 =0
x(x+20) -16(x+20) =0
(x+20) (x-16) = 0
Hence number of books shopkeeper buys x = 16.