He said that if he had had a pen, he could have written the letter. (= possibility)
This means that if he had had a pen at that point in time, he would've had the possibility to have written the letter, but not neccessarily have written the letter. It implies that he would've had the choice to write or not write the letter (if a pen had been available to him).
If you say
He said that if he had had a pen, he would have been able to write the letter.(= ability)
This implies that he would have had the ability to write the letter, and says nothing about his choice to do or not do so.
Indirect speech means that you'll relate what was said without quoting directly. This is done by news organizations all the time to sum up what politicians say. E.G. "Today in a press conference the president said the situation in ..."
For your excerpt, first we need to drop the quotes and take the quoted text out of first-person ("me/my" > "her"):
... forgive her her fault and let her appear at the exam
Now we need to join that up with the first half of the sentence, but that will need some converting too. There are a couple ways to do that & what you choose is a question of tone:
She said the Headmistress should forgive her her fault and let her appear at the exam.
This is close, but the use of "should" sounds more like a demand than the humble request it really was. So let's try swapping the main verb:
She asked the Headmistress to forgive her her fault and let her appear at the exam.
This version is closer in overall tone to the original, but to illustrate the point, let's go further into humility:
She begged the Headmistress to forgive her her fault and let her appear at the exam.
Note that some will say all of my examples have a problem with which female "her" refers to. Strictly speaking, that's true (although the vast majority of people will take the correct meaning away from each version).
So here's a strictly correct variation:
The headmistress was asked by the student to forgive her her fault and let her appear at the exam.
Best Answer
He said, "Let me ask you a question."
let is asking for permission to do something- a request.
According to the Oxford Guide to English Grammar, section 270.1.a, we represent requests in reported speech by using ask + object + to-infinitive:
That could probably be said more clearly in other words, but it is an exact reported speech version of the original sentence.