This is an embedded question requiring subject-verb inversion. When a question is embedded within another sentence, the auxiliary verb comes before the subject: 'What exactly do I have to do?' Not 'I have to' or 'I had to,' which are statement word orders.