Answer
Most of the book of Deuteronomy consists of “farewell speeches” that Moses delivered to the children of Israel before their entry into the Promised Land. Before his passing, Moses recorded his speeches and “entrusted them to the Levitical priests, who carried the ark of the covenant of the Lord, and to all the elders of Israel” «And Moses wrote this law, and delivered it unto the priests the sons of Levi, which bore the ark of the covenant of the LORD, and unto all the elders of Israel. », (Deuteronomy 31:9). Moses is acknowledged as the author in the book of Deuteronomy «And Moses wrote this law, and delivered it unto the priests the sons of Levi, which bore the ark of the covenant of the LORD, and unto all the elders of Israel. », (Deuteronomy 31:9,24) «And it came to pass, when Moses had finished writing the words of this law in a book, until they were completed, », (Deuteronomy 31:9,24), and Jesus frequently quoted from Deuteronomy, affirming Mosaic authorship (Matthew 19:8;citing Deuteronomy 24:1-4). However, the final chapter of Deuteronomy raises the question: who wrote Deuteronomy 34, which records Moses’ death?
God had informed Moses that he would not lead the children of Israel into the Promised Land due to his past disobedience «And the LORD spoke to Moses and Aaron, Because you did not believe me, to uphold my holiness in the sight of the children of Israel, therefore you shall not bring this assembly into the land which I have given them. », (Deuteronomy 34:1-6). Following Moses’ death, the leadership of Israel was passed on to Joshua (Deuteronomy 31:7,14;Numbers 27:18-23).
Without a doubt, Moses wrote Deuteronomy towards the end of his life. It is probable that Joshua, who succeeded Moses as the leader of Israel, wrote about Moses’ death. Other suggestions include Ezra as the author of Deuteronomy 34 or the seventy elders who served under Moses (see Exodus 24:9).