an (or ar in most cases in the past tense) is a question particle. It marks the fact that you're asking a question, and it eclipses the following verb.
Téim chuige -> I go to him
An dtéim chuige -> Do I go to him?
Ní théim chuige -> I don't go to him (ní is a negative particle which lenites)