The end of Deuteronomy is the end of the Pentateuch and it is ominous, for, in his Song, Moses already foresees Israel's betrayal and the harsh consequences to follow.
Moses calls heaven and earth as witnesses. Indeed, every lawsuit requires two witnesses who are upright and agree in their testimony, and what heaven and earth will witness is one: the constancy of God's love and the vagaries of his chosen people.
Despite his best efforts and despite the years spent in the wilderness, Israel will not be able to stay faithful to the covenant. This conclusion is not a proclamation of defeat; rather it is the assurance that God knows beforehand that Israel will betray him and therefore he has already factored these betrayals as part of his mysterious plan of salvation.
The same holds true in our lives today. Before we were born, God knew us, therefore he knew our weaknesses, our sins, and our inability to keep to the straight and true. But like Israel, if we come back to him with all our heart, our mind, and our will, he is always ready to forgive and restore, to give us what we have lost and multiply it to the greater glory of his Name.