Tom O'Bedlam was a phrase used for a mental patient of the Bedlam Hospital, which had mental patients as early as 1403. Bedlam Hospital was known for its seeminly low respect for the mentally insane and was also a form of entertainment for the upper classes at one point. In later days, Tom O'Bedlam was applied to mean any insane person.

Tom: "Who gives anything to poor Tom whom the foul fiend hath led through fire and through flame."
Edith: Being dead has certainly not improved your rendering of Shakespeare, Freddie. You've brought the cold with you.

Tom O'Bedlam is also a character in Grant Morrison's comic book series The Invisibles. Tom has a tendency to continually quote lines from King Lear that his namesake said.

Fredrick "Freddie" Harper-Seaton was the son of a magician in a group similar to the Hermetic Order of the Golden Dawn. He joined the Invisibles by 1924 with his cousin Edith Manning. He took Tom O'Bedlam as his name upon joining the Invisible College, and ignores his father's requests to not take such a magical name. For great consequences could come upon a person choosing a name so imbued in insanity. Freddie, however, was greatly afraid of magic and his father, and probably only took the name in order to rebel against his father.

Harper-Seaton Senior: This name you have chosen invites madness and darkness. Fredrick. My son. Please... Will you not hear me?

Freddie also shared a psychic link with his cousin Edith. Throughout the years he was always able to hide his thoughts from Edith when he wanted to. The one thing he always hid was his love and jelousness of her sexual escapades. Edith believed Freddie to be homosexual for a long time, and treated him like a pet project.

Freddie: I've become afraid of everything, an angler in the lake of darkness.

During the time in which he joins the Invisibles and stays with Edith, he's a rather ineffectual member. In 1924 when the cell gets the Hand of Glory and access Universe B, he goes mad for six months. Tom becomes a mage by 1960 under the Ordo Templi Orientis while using his real name. He also meets Miles Delacourt during this time.

He also keeps in contact with the Invisibles, as well as teaching King Mob how to make shortcuts through space by using Universe B. In 1995, Tom is homeless and lives in the streets of London. Tom is contacted by Edith in the summer of 1995 to induct Dane McGowan, also known as Jack Frost. Tom helps Jack get control of his powers as well as his Jack Frost identity. Tom's lessons can lean over to the rough and mad side, but Jack and Tom seem to develop an odd friendship. Tom also helps Jack see the world in other perspectives as well as the Arthurian lesson of being moved into the viewpoint of a pigeon.

Dane: Magic? You're a fucking nutcase.
Tom: Then keep well away, for madness is catching. Away, the foul fiend follows me.

After Tom puts Jack in contact with BARBELiTH, he puts all of his possessions into a bag and leaves them in a locker for Jack. Tom then proceeds to go underground and dies homeless and without any possessions. In the end, he was probably one of the most powerful human magicians that had ever lived.

Tom: "Pluto Laughs and Proserpine is glad to see poor naked Tom O'Bedlam mad..."
I'm ready now. The party's over. All's well.

Sources:
Anarchy for the Masses - by Patrick Neighly and Kereth Cowe-Spigai