The part of a dog's body that wags enthusiastically when the dog is happy is the tail. In mammals, tails are actually an extension of the spinal column.
Tails serve various purposes in different animals. A fish's tail helps it move through the water, a cow's tail is a built-in fly swatter, and a scorpion uses its tail for self-defense. This noun also means simply "back end," like the tail of an airplane or the tail of a suit jacket. Colloquially, to tail someone means to follow them secretly.