I submitted a research paper and the reply has come back. The reviewers are positive overall, but one of them pointed out a flaw in one of my proofs. This happened because I made a wrong assumption regarding the proof. Now I have found a way to get around this and have a better proof. How do I present that my previous proof was wrong, the reviewer was right in saying so, and that now I have a better one?
If the reviewers and subsequently the editor does not consider the error enough to warrant rejection, you should simply make the changes necessary and submit the revised manuscript according to instructions. Since the reviewers spotted the errors you should acknowledge their helpful comments (unless this is not the custom in the field for some reason).
It seems to me that you may be lucky to get the chance to revise the manuscript since the type of error you describe, I would think, would likely lead to rejection. But, with a favourable verdict you just revise the manuscript and return it as per instructions.
Just fix the proof. Especially if you feel that the reviewer gave helpful suggestions about how to fix the proof (beyond just pointing out that the original version was wrong), you could consider adding an Acknowledgments section thanking the anonymous referee for pointing out the error in the original proof of Theorem X and/or their suggestions of how to fix it.
You don't need to apologize for your mistakes, either in the paper or your reply to the referees' comments. In your reply, you should of course acknowledge the error, thank the referee for pointing it out and say that you've fixed the problem.