"I ask him."
Translation:Eu pergunto a ele.
Some verbs take direct objects, others take indirect objects, some of them takes both, others take none.
The indirect objects must have a preposition. That is the case of the verb "Perguntar" in Portuguese.
You ask something (direct) TO someone (indirect).
In Duolingo's sentence, the something is not there, only the indirect object (to someone) is present.
Expanding a bit on that, in English you say "I ask him", but you can see that it's an indirect object when you put it this way "I ask a question to a particular person", even if we'd generally put the indirect object first (ask a particular person a question), you can see the "to" popping up. Or in the question "Who are you asking that question TO" (to whom). So English has the same structure in this case.