Extending my comment to an answer, and incorporating what rm -rf said as well:
I hold that the primary purpose of this site is to help people, and that includes those who are asking questions. (It is not limited to those who ask questions and includes those who find the site through search engines but never participate, but I refuse to accept that the search-engine-visitors are the primary benefactors; they may be the most important for the financial success of Stack Exchange Inc. but that is not my reason for being here.)
To that end I say post an answer to a question, even if it is going to be closed, if:
Your answer will be immediately helpful to the question author in a way that a referenced answer will not. Example: a specific and not entirely obvious or transparent application of an earlier solution. Counterexample: simply copying, rephrasing, or recreating an existing answer.
You are diligent to minimize duplicate posts, recognizing that excessive duplication only results in redundant effort and scattered information, discouraging both those who answer questions and those who seek answers. Example: make a reasonable effort to find duplicates for every post you believe may be one, including those you answer, and voting to close or commenting accordingly.
You have no expectation that your answer will gain for you permanent reputation points; a question that is a duplicate or "easily found in the documentation" may be both closed and deleted, and your effort and points will go with it. Remember: you're answering this question for the immediate assistance of the OP and nothing more.
Lastly, and certainly not insignificantly, you are not supporting a pattern of low quality, zero-effort, or otherwise detrimental questions that only take space and attention from better questions that have a broader audience. This is perhaps the most difficult to objectively judge; if you notice that questions you answer are rapidly closed or down-voted by others you should contemplate the possibility that you are supporting such a pattern.