Writing, which was invented around 3,000 BC was invented not for the writing of books, but rather the keeping of books.
Writing was invented to keep track of inventories and transactions.
All literature and stories at that time were conveyed orally.
The first simple papyrus and clay tablet books were not written until roughly four centuries later.