Pre-Zero Hour: Brainiac 5 is a member of the Legion of Super-Heroes in the 30th Century. Born on the super-intelligent planet Colu, he is a 12th-level intellect considered a genius even by their standards. This makes him an incredible scientist, inventor, and strategist in combat. His ancestor is the super-villain Brainiac, and he takes this name to redeem his family's lineage.
Post-Zero Hour: Querl Dox, or Brainiac 5, was a Coluan member of the Legion of Super-Heroes with a supremely advanced intellect. While his ancestor Brainiac was a supervillain, Brainiac 5 strove to atone for the misdeeds of his lineage. His longest romantic partners have been Supergirl, Andromeda, and Dream Girl.
The New 52
Brainiac 5 seems to be largely unaffected by the changes of the Flashpoint miniseries, as is true for the Legion of Super-Heroes as a whole. However, the term "Brainiac" is no longer his name but an honorable title. This adds understanding to the opening arcs of Action Comics vol. 2 (2011) by Grant Morrison, where an alien is stealing and bottling cities, an act usually committed by Brainiac, but is here only named "the Collector".