Moses was told by God to go up to a certain mountain where he was going to die. If it were just Moses and God on the mountain, who is writing this verbiage? Who was there to witness what was said between the two?
The Holy Book of Deuteronomy testifies, for the most part, that Moses wrote it (1:5, 31:9, 22, and 24). Other Old Testament Holy Books agree with this (I Kings 2:3, II Kings 14:6, 18:12) although Moses' death in Chapter 34 was known to be written by someone else. The Lord Jesus Christ Himself bears testimony to Moses’ authorship of the Holy Book of Deuteronomy (Matthew 19:7-8, Mark 10: 3-5, and John 5:46-47). In the New Testament alone there are almost 100 quotations of and references to the Holy Book of Deuteronomy. Tradition also testifies to the Mosaic authorship of the Holy Book.
Joshua commanded the death of Moses to be written or wrote it himself. Joshua, as you know, led the people of Israel following Moses’ death. How did Joshua know what happened on the mountain? As you know the Holy Scriptures are written by the inspiration of the Holy Spirit.
Joshua wrote his own book except for the final section, which addressed his funeral, which is attributed to Eleazar son of Aaron. On at least two occasions the text of the Holy Book reports writing at Joshua's command or by Joshua himself.