Of course having told the Israelites to choose life in the last chapter, Moses goes straight on to prepare to die.
He writes a book of the law. He creates a public ritual/celebration every 7 years to read the law. He writes a song of the law. I think he wants them to remember the law.
But more than that, he knows they will fail, through bitter experience, and it’s poignant because he loves them. He calls the law a witness to them. It’s so like a parent’s mixed emotions, torn between knowing they must journey on without him, and wanting to protect them forever, leaving only words behind.
He appoints Joshua to follow him, and tells him to be “strong and courageous”. Courageous is one of my wife Kelly’s favourite words. It is not only a powerful idea, the act of saying the word seems to make it real, to create a space for courage.