0 was discovered by Q in his Q's "youth" when Q asked the Guardian of Forever to show him "something new, something different", the Guardian subsequently displaying various images and events, with Q picking one at random.
At their initial meeting, 0 appeared to be a shabby but intricately dressed mischievous ne'er do well—a facade that reflected none-too-accurately his true appearance and nature; an exiled and partially crippled (he could no longer travel at warp speeds under his own power) entity of formidable power, intellect, and as became evident rather quickly, evil.
Upon Q's invitation to his "home" universe, 0 encountered a setback—The Guardian, recognizing that 0 did not belong on that plane, attempted to restrain 0 and prevent him from crossing the "border" from his exile plane to the universe beyond. Q, not yet aware of the disastrous outcome of his actions, viewed the Guardian as little more than a "pompous piece of rock", and he pulled 0 through the barrier and into our universe.
Their first port of call was the Q Continuum, although the other Q were more than slightly apprehensive at the arrival of this mysterious, powerful entity. Q was charged with being 0's "keeper", and vouched for him, believing that it was safe to accept responsibility for 0's actions. Exiting the Continuum, Q began taking 0 for a tour of our universe, oblivious to the entity's true intentions.
Before long, they both encountered the Calamarain, who at that point in time were known as the Coulalakritous. After observing them for several minutes in disguise, 0 declared that he would "use" them as transport to compensate for his current weakness, and attempted to restrain them. The Coulalakritous, being none too impressed with this attempt, forcibly ejected both Q and 0 from their group. Enraged, 0 compressed the gaseous entity to the point of being a slush, then ice, and attempted to compress them further (perhaps to create a singularity out of the unfortunate entities' forms). Q stepped in at this point, calling an end to the torture (and in the process bore the brunt of 0's fury for a brief moment). 0 apologized, pleading momentary frustration and Q accepted, albeit cautiously.
Returning to the Guardian's planet, 0 called forth his three "friends and contemporaries", similar entities with malevolent purposes: (*) (encountered by James T. Kirk at Beta XII-A), Gorgan (later responsible for a series of murders of the old by the young, witnessed and stopped by Captain Kirk) and The One (later encountered by Kirk at the center of the galaxy).
0 goaded Q into trying his hand at "testing lesser species" (in fact he was likely the person responsible for instilling this desire into Q in the first place), a task that Q took to with relish, albeit immature relish—he was responsible for a planet-wide shower of fruit on one of the main planets in the Tkon Empire. 0, however, had other plans for the Tkon, he and his fellows manipulating their entire civilization into a massive civil war between Tkon and an outer-system planet, Rzom, intending to distract them from their current "Great Endeavour" to replace their dying sun with a new one. Despite the odds against them, the Tkon were able to complete the Great Endeavour, only for 0 to interrupt them at the last minute. In an act of almost unparalleled sadism, 0, disgusted at the idea that the Tkon could ever overcome something like him, caused their sun to go supernova only seconds before it was to be replaced with a new, fresh sun. This act alone demonstrated how different he was from Q; even when it meant that he might not win, Q always gave lesser life-forms a chance at success, while 0 simply changed the rules completely when it seemed like the Tkon Empire might triumph over him.
This act, the ultimate in a series of distasteful ones, caught the full undivided attention of the Q Continuum. They declared war upon 0 and his compatriots, pitting four against four (the rest of the Continuum being occupied with controlling the side-effects of the crisis)—0, (*), Gorgan and The One vs Quinn, Q2, the female Q, and the Quaestor. Q was pushed to the sidelines, where he observed the proceedings in anguished regret. The ultimate end to this battle was eventually decided by Q himself who, after defending the female Q from an almost-fatal attack from 0, stepped in to protect the Quaestor at the pivotal moment. This act not only momentarily shelved 0's powers, it drove him over the edge, into pure unbridled insanity.
After all was over, a court of Q was called into session. (*) and Gorgan had already escaped into the black hole that existed where the Tkon sun once was, but The One and 0 remained. The One, who had been dismembered and depowered by the Q, was banished to the center of the galaxy, and 0 was eternally banished from the Milky Way, the galactic barrier being erected to prevent his re-entry, his inability to travel at light speed meaning that he was going to be alone for millennia even if he immediately set off for another galaxy. Q was charged with watching over the primordial Earth because of the damage done by the asteroid.
0 regained entry to our galaxy briefly, when a Betazoid scientist, Doctor Lem Faal, perfected Dr. Lenara Kahn's wormhole technology. A piece of 0's consciousness had slipped through a crack in the barrier created during the Q Civil War and joined with Faal, promising him immortality after providing him with subtle hints as to how to penetrate the barrier; Faal, suffering from Iverson's Disease and eager to make his mark on the universe, gladly accepted. After emerging into our universe through a wormhole that existed for a mere second, 0 attacked the USS Enterprise-E, leaving only Q to stop him as he set the ship on course for galactic centre to retrieve The One. However, Q quickly realized that his old mentor's 600,000 years in exile had left him completely and irreparably insane, incapable of even recognizing the basic underpinnings of reality, thus granting him power beyond even Q.
Despite Q's best efforts, 0 nearly killed him before Picard was able to convince the Calamarain, who had been attacking the Enterprise-E in an attempt to prevent the wormhole experiment, to help them fight 0. On Picard's advice, the Calamarain merged with Q after Angosian security officer Baeta Leyoro was killed extracting them from a crystalline lattice which 0 had compressed them into. Their differences set aside, Q and the Calamarain became a single consummate entity, two infinite powers combining to become more than the infinite. Unable to match this unexpected new foe, 0 was easily beaten and re-exiled to the void, any weaknesses in the barrier repaired, and the whole barrier reinforced. It is presumed he remains there as of the late 24th century, as insane as ever, uncertain whether he was ever even freed in the first place. (TNG - The Q Continuum novels: Q-Space, Q-Zone, Q-Strike)