How could Moses have written the first five books of the Bible when the fifth book, Deuteronomy, reports his burial in an unknown grave?
Obviously Moses did not write in advance the account of his own death. Deuteronomy 34 is an obituary written by a friend and contemporary, possibly Joshua the son of Nun (v.9). Under the guidance and inspiration of the Holy Spirit, then, Joshua possibly appended an appropriate record of the death and burial of his revered master and framed the eloquent praise with which the book closes. There is no reason to believe that Moses is not responsible for Genesis 1 through Deuteronomy 33.