Moshe finds out he will soon die. We find the unusual phrase of “And Moshe spoke to Hashem saying.” in 27:15. I say it is unusual because we usually have God speaking to Moshe, not the reverse. Here we see the reverse.
So what does Moshe tell Hashem? He goes into a speech in which he explains how important it is to appoint a successor to lead the Jews into Israel and that it should be somebody who has merits and can lead, etc.
Did Moshe really think Hashem would knock off Moshe and leave Bnei Yisrael without a leader? After everything Hashem had done the previous 40 years or so, taking them out of Egypt, through the desert, to the cusp of Eretz Yisrael and Moshe thought Hashem would now abandon them to their own abilities and forces? Moshe must have known Hashem would appoint someone, so what is the big discussion here?
Rashi tells us that the Torah is showing the greatness of the righteous (and Moshe in particular) that they are concerned with the welfare of the community even to the point that at the time of their deaths they are concerned with the public rather than closing their own affairs.
Of course Moshe knew Hashem would make sure the Jews were taken care of and had a leader. However, he felt it important to deal with the issue of appointing a successor while he was still alive, to ensure the smooth transition of leadership.
We see nowadays many organizations and groups who suffer from not planning the future leadership properly. The top brass leave or die and suddenly the whole organization is in turmoil. People do not know who to turn to. Oftentimes there is a split in the organization because of competing rivals looking to take the leadership role, etc. Other times there is a void as the competing rivals duke it out and the ones to suffer are the regular people who end up with no real leadership.
Yes, Hashem would take care of it. But a true leader makes sure his people are taken care of and does not leave it for other people to worry about. Moshe had to make sure his people would be taken care of. That is why Moshe spoke up now.