While tradition holds that hair must be chopped off if it gets gum in it, in fact, it's possible to remove gum from hair by applying an oily substance and combing the gum out bit by bit. Some substances also help to dissolve the gum in place.
Using an oily substance to remove gum from hair allows the oils to start to soften and dissolve the gum. Apply the olive oil, creamy peanut butter or other oily substance to the gum, working it in gently with either your fingers or an old toothbrush until the gum is completely saturated. Wait to let it work, then gently begin to comb the gum out of the hair bit by bit. Wipe the comb frequently while combing to remove pieces of gum from the comb and avoid transferring them back to the hair. Once the gum is removed, wipe the hair clean with a dry cloth to remove as much residue as possible, then wash the hair.
Other solvents that can help dissolve the gum in place include rubbing alcohol, mayonnaise and adhesive remover. Substances that lubricate the gum to make it slippery without dissolving it include toothpaste, petroleum jelly, hair mousse, cold cream and WD-40. If one substance doesn't work well, try another one, and just keep working patiently until all the gum is removed.