If I've found an error in my answer, should I delete the answer or just to post a comment saying about the error?
It seems that reading my answer may be helpful for finding a true answer.
It's entirely up to you, but here's what I would personally recommend. If the flaw in your answer makes it provide little substantial progress towards answering the question, I would probably just delete it. If your answer still provides some interesting progress towards answering the question, however, I would instead edit the answer to either remove or point out the mistake, and make it clear that your answer is not a complete answer to the question. Another reason you might choose to not delete an incorrect answer is if your error actually shows that some reasonable proof strategy is doomed to failure, in which case (even if it doesn't directly help answer the question) it may be useful to others trying to answer the question or provide some general insight into the problem. In addition to editing or deleting your answer, you may also want to write a comment on the question itself so that the asker gets a notification, particularly if they have accepted your answer or it has been a long time since the question was originally asked.
I would actually recommend strongly against just leaving a comment on your answer (rather than on the question) and not editing or deleting it, as you suggested. The reason for this is that it does not bump the question to the front page or provide a notification to anyone, so unless the question was asked very recently, there is a good chance that no one will even notice your comment for a long time.
Thats up to you – but if your answer is wrong, it will be downvoted and you'll lose 2 rep (from every downvote).
Deleting your answer permanently will count toward the answer ban, so what would I would delete, correct my answer (you know that you can edit your answer, right?), and then undelete.
But if you don't know how to correct it, I wouldn't keep it anyway.