You should not answer off-topic questions. However, ...
Reasonable people can disagree about whether a particular question is on or off-topic. If you think it's on topic, you should answer it even if others disagree.
You should not answer off-topic questions
Other Stackizens have written about this so I will quote from the top answers of each of the following MSE posts:
Should I answer off-topic questions?
Is it bad to answer off-topic questions, knowing they are off-topic?
Is it bad form to flag a question AND answer it?
Should you answer a question you think should be ...