In two letters, the former substitute teacher called students a racial slur and threatened the teacher and students, officials said.