I wonder why "to" was used here, because it seems okay for me to say without "to that." And is it okay to replace "to" with "for", "of"?
Native speaker’s answer
Rebecca
The preposition "to" is used here to express that an answer is going along with the question. Prepositions are very idiomatic in English, so when talking about an "answer", it sounds most natural to use the preposition "to". You can replace "to" with "for" here, but not with "of". Ex: I don't have an answer for that question. Ex: Do you know the answer to that?