Signs of pain in the dog are: vocalization, changes in drinking, eating, socialization, self-mutilation, increased or decreased energy level, facial expressions (enlarged pupils, flattened ears), lameness (non-weight bearing, sitting with leg out, etc.), change in posture (hunched, unusual positions) and aggression or fearfulness.
Cats are typically harder to recognize pain as they are normally more elusive. Most cats hide when they are in pain, so unless you see them out, you may not pick up on their pain. Changes in the litterbox habits can also be signs of pain. Vocalization, restlessness, changes in their activity level, unusual postures, lameness, and aggression.