Weighing in as a high rep user that does frequently answer questions that are either a) off topic or b) possibly duplicate, there are a few different reasons.
For questions which are off topic for all SE sites, I advocate not voting up answers even if they are good. They are unrelated to the site and shouldn't be a source of reputation. I will sometimes answer an off topic question if it is just barely off topic or if I can provide quick assistance to someone who is in a bit of a bind, however it isn't why the site is here. I actually often vote to close a question while also answering it for this reason.
For questions which are off topic just for photography, I will vote to close and mention the site it fits on. I answer the question anyway and upvotes make sense because it will help the question get a solid start after being migrated to the correct site (answers and votes will follow it over). I almost always answer these if I can because it will be useful upon migration.
Possible duplicates have a few different situations as well. In some cases, I believe it is a duplicate and will vote to close as duplicate but may answer because there is some slight difference in the question that may not merit its own question, however some further clarification may be needed to lead in to the slight differences on the dupe. In this case, I will try to include the necessary primer in an answer and will fill it out a little for completeness. I don't think these need up votes because they are more or less comments that point out the answer.
Another situation is that I disagree with the duplicate, this is a step further than the previous, where instead of thinking it doesn't merit its own question, I instead think that it is different enough in some way to merit its own question. I'll generally try to emphasize that difference when answering and will often make a comment as well as to why it shouldn't be closed as duplicate.
The third category is simply that I'm unaware of a duplicate. I don't often go searching for duplicates when answering questions unless I recall having seen similar before. If that is the case, then I'll write a full answer and hope that it gets merged when closed as duplicate.
I guess a final minor category is on simple questions I may post a quick answer to be helpful even though there is a duplicate that speaks to it. This is often to give a quick response rather than having them have to sift through multiple responses and I don't expect up votes on it because it isn't an answer with any substance, it is just a quick assist to help them in the right direction.
I also tend to answer on the new question if there isn't a good answer on the old, but I suppose that is probably a practice I should alter. It isn't however always clear which of several possibilities will be selected as the duplicate.
I suppose what that all comes down to is that if the answer provides a substantial answer for a question that is on-topic somewhere on SE and it is not a duplicate of an answer that that answerer has already provided, then I think it merits an upvote. If it is a quick and dirty answer just to give a direction to go in and/or is not on topic for any SE, then it should be left alone.