"Were you talking?"
Translation:An raibh tú ag caint?
Is it used with 'ar'? To ask a question about something done in the past?
No, bí is one of the irregular verbs that uses an rather than ar for a past tense question, so An raibh … ? rather than Ar raibh … ?.
Would "An raibh tú ag labhairt?" work here, too? Or does it have a slightly different meaning. Duo marked it wrong.