How to mark an ant with the least disturbance to the ant and the nest
For this purpose, people usually paint ants on top of the thorax (not on the head where it can prevent eyes and antenna to function normally, nor on the abdomen where it can block the spiracles and prevent respiration), with a bit of acrylic paint applied with a toothpick. Combination of colors are used to identify individuals.

These techniques are currently being replaced by the use of RFID tags and Flashcodes in science, to automate recordings.