A tattoo machine (aka "tattoo gun") is the tool that tattoo artists use to put tattoo ink under the skin. Note that many artists object to the term "gun" because they believe it has negative connotations.
Samuel O'Reilly was the American tattooist who first patented the electric tattoo machine. His design for the tattoo machine (or as he called it, "tattaugraph") was based on Thomas Edison's design for the "electric stencil pen". O'Reilly's apprentice, Charles Wagner patented a new design for a tattoo machine based on O'Reilly's except the coils were aligned differently.
The modern western tattoo machine usually works through two electromagnets driving a spring-loaded reciprocating needle assembly. This assembly penetrates the skin about 6000 times per minute, although this rate is varied depending on the type of needle being used.