Following the Song of Haazinu, it says that Moshe and Yehoshua taught the song together. Rashi explains that this was in order that the people should not later question the authority of Yeshoshua when he became Moshe's successor.
Why was this important and why did most people misunderstand who Yehoshua was?
Based on Likkutei Sichos vol. 29, pp. 199-202.