In chapter 34 of Deuteronomy, there are textual indications that Moses did not write the book of Deuteronomy.
First, chapter 34 records the death of Moses, but how could he record the events surrounding his own death?
Second, verses 1 and 2 state that the Promised Land includes “Gilead to Dan, all of Naphtali, the territory of Ephraim and Manasseh, all the land of Judah as far as the western sea.” The problem here is that only Reuben, Gad, and Manasseh had been given their land up to this point. Dan, Naphtali, Ephraim, and Judah would not receive their land until many years after Moses died.
Third, the author states in verse 10 that “since then, no prophet has risen in Israel like Moses.” This sentence would only make sense if someone was writing this text well after Moses’s death.
Do these texts prove that Moses did not write Deuteronomy? No, not at all. It is entirely possible that Moses wrote most of the book, but that later writers added to the end of the book. In fact, Jewish tradition holds that Joshua wrote some, if not all, of chapter 34.
We have strong internal evidence that Moses did indeed write the majority of the book of Deuteronomy from Deut 31:9 and 31:24. These verses reveal Moses’s command to the Levites to take the law Moses wrote down and store it with the ark of the covenant. Taken in context, what parts of Deuteronomy would have been considered the law?
Eugene Merrill, in The Book of Deuteronomy (New International Commentary on the Old Testament), describes what verse 9 and 24 would be referring to:
The term for ‘law’ (here tôrâ) normally refers to the Mosaic writings generally, but in the context of Deuteronomy it must be limited to that book alone and, in fact, to just the covenant text of chaps. 5–26 (plus the blessings and curses of chaps. 27 and 28).
Therefore we conclude that at least chapters 5-28 were most likely written by Moses, and quite possibly more. To think that chapter 34 proves that Moses had no hand in the composition of Deuteronomy is simply wrong.