There is nothing more discouraging in your painting rhythm than when a brush sheds on your canvas. Stray hairs leave odd marks during the painting and then are difficult to remove if they dry there on the canvas. A flawed painting is not what one wants to send to a collector, gallery or potential buyer.
So, it is first of all important to check out brushes when purchasing. It can be natural for a brush, especially a natural bristle brush, to lose a few strands during the first rinse. However, during brush shopping, test the brushes with your fingers by gently pulling on the bristles to see if they are tightly adhered. In quality brushes, the bristles are both glued and clamped into the ferrule, and sometimes also tied. So, a gentle tug should let you know if the bristles are there to stay. Be wary if any come out at your touch.
Some retailers may take back a brush if it has been rinsed only, no paint, before use. Rinsing will remove stray hairs and the starch that is put on the brush during manufacturing to keep its shape during shipping and display. If a brush falls apart during the rinse, it won't hold up to paint. You can also comb out a brush softly before use. If the brush loses a few hairs, it is possible they were either not glued in well or were too short to reach the adhesive in the ferrule. So, the brush might be just fine, having shed all that it will. However, if the brush continues to lose hairs, it is likely defective and you should contact the manufacturer.
Lastly, care for the brushes as if you'll never buy another. Some artists condition their brushes with lotion or hair conditioner; other artists use quality conditioning soaps for cleaning. Everyone has their method of brush care, and if you want more details on brush cleaning, check out my prior post on cleaning. Cleaning right after use will keep your brush in shape and prevent having to soak your brush for long periods if you've left it in dirty water or solvent too long. Soaking a brush can sometimes remove hardened paint, but it also has a tendency to loose hairs in the ferrule as the adhesive often softens during soaking. Cleaning immediately after use is the best way to keep your brushes happy for decades to come.
Resources: Turner, Jacques. Brushes: A Handbook for Artists and Artisans. New York, Design Press, 1992.
For more brush information, check out the Dynasty Brush website.