Yes-no questions (closed questions) begin with if when they become reported questions.

She asked me if I have been to Bristol?She asked me what I do for a living.

She asked me if I had been to Bristol.She asked me what I did for a living.

If the reporting verb (in this case ask) is in the past tense, we usually change the tense of the verb which follows: I am ⇒ I wasI can ⇒ I couldhave been ⇒ had beenwas ⇒ had beenwill ⇒ wouldcan ⇒ could