You cannot prevent students from editing posts and replies they create in the discussion tool. However, you can track the history of each post.
Start by going to the "Tools" dropdown in the blue navbar and click on "Discussions." Next, navigate to the topic you want to view and click on the caret next to it, then click "view topic."
Next, click on the caret next to a thread, then click "View Post History"
Once you have done this, a pop-up window with further details will open for you. You can see all changes made to the post- who made the change, the details
of the post change, as well as the date and time of any given change.