Answer explained
Direct speech of: He asked me if I had posted the letter. is
Correct answer: (B) He said to me, “Have you posted the letter?”
In the expected reverse transformation, had posted returns to have posted and the yes/no question is put inside quotation marks.