答え and 返事: an answer's content and a response
Distinguish a solution from responding to a request, including responses that do not resolve the question.
An answer to find
答え, read こたえ, means an answer to a question or problem. 計算の答えを確かめました。 means checking the answer to a calculation.
答えが二つあります。 says that there are two answers. Whether both are correct needs additional information.
Responding to another person
返事, read へんじ, is a response to a call, question, or request. 頼み事に返事をしました。 means responding to a request.
すぐに返事はできません。 says that an immediate response is not possible. Do not turn it into a refusal of the request.
Response and resolution
「分かりません」と返事をしました。 means responding, 'I do not know.' A response was given, but not a solution to the problem.
答えを考えてから返事をします。 says that someone will think about the answer before responding. Preserve the order.
In 「分かりません」と返事をしました, was there no response?
Show the answer and why
There was a response: 'I do not know.' It simply did not provide a solution.

