So who did write about Moses' death as it is recorded in Deuteronomy 34?
Here are three reasonable options:
First, Moses himself could have written those words because God had already told him that he was going to die. God even told him when he would die.
Here is that conversation:
48 On that same day the Lord spoke to Moses,
49 “Go up Mount Nebo in the Abarim range in the land of Moab, across from Jericho, and view the land of Canaan I am giving the Israelites as a possession.
50 Then you will die on the mountain that you go up, and you will be gathered to your people, just as your brother Aaron died on Mount Hor and was gathered to his people." Deuteronomy 32
As always, Yahweh was crystal clear about what was going to happen to His servant Moses. Moses had seen Yahweh do many great miracles consistently for over 80 years, and so he had no reason to doubt God about his pending death.
So that is our first possibility: Moses could have written that ending himself.
The second possibility is that it was Joshua or one of Moses' scribes who penned in those last words after Moses had died.
Moses had already written 5 entire Books which we now divide into 187 chapters. If Joshua or a scribe had added that epilogue to the other 33 chapters of the Book of Deuteronomy...
would we say that Moses was no longer the Book's author?
Of course not.
The Pentateuch has a total of 5,852 verses.
If Moses wrote all but 12 of them, would we say someone else wrote the Torah?
Of course not. The idea is simply ludicrous.
But scholars point out that there is one more explanation for this portion of Deuteronomy (there may be other theories). And it is that, since the Scriptures used to be kept in rolls prior to the invention of the book in the 1st century AD, it could be that Deuteronomy 34 is actually the first chapter of the Book of Joshua, the book which follows Deuteronomy in the Bible.
Which means that Joshua, Moses' right hand man and the one chosen to take Israel into the Promised Land, could have written that epitaph for his friend Moses.
Any of these three possibilities are more than reasonable solutions to this question. With that being said, we remember these wise and realistic words: