convert to reported speech-
he said,"I am doing my duty."
He said that he was doing his duty.
We use "told"only when there is "said to ---" in the direct speech, or the subject is referring to somebody.
We use "told"only when there is "said to ---" in the direct speech, or the subject is referring to somebody.