Change the narration: He said to her, "Why did you lie to me?"

Change the narration: He said to her, "Why did you lie to me?"

Explanation

He asked her why she had lied to him.

The reporting verb “said to” becomes “asked” for a question.

In indirect speech, the past simple “did lie” changes to past perfect → “had lied”.