The point of voting to close a question is first and foremost to prevent it from receiving answers while it's being improved by the asker. Closing is not a permanent state, but in many cases questions remain closed because the asker never returns and tries to improve the question.
I have found myself voting to close questions and then coming back to provide an answer while the question is still open. Sometimes it's been because I miscalculated the question and ended up being the only close voter and other times it's been because the question was interesting, I knew the answer, and wanted to help.
If you're doing this, ask yourself why you're doing this. If your goal is to help someone with a problem, then it's likely to be more acceptable than if your goal is to try to get an answer in purely for the reputation score.
With that said, if the question is overly broad or too vague or can't be answered, don't try to answer it. Your answer most likely won't be any good, and you'll only attract negative attention from the community.
If the question could be improved, and you answer it before it's closed. Be prepared to come back when it's reopened and edit your answer based on new or changing information in the question; otherwise, you may attract downvotes and unwanted attention.
Let me put it this way: If a question wasn't supposed to be answered after you cast your close vote, surely the Stack Exchange developers would have thought to disable the answer button in order to prevent such actions.
Should you remove your answer on a dup:
If your answer repeats things already said, try to think of some edits you can make to improve it or differentiate it from the pack. If you're just repeating what is already said, then you can remove it.
On some duplicates, if both questions have valuable answers, a moderator may merge the answers from one question with another. So don't remove your answer unless it's not adding value.