It's a rule called the "first sale doctrine" that allows you to do this. If you're surprised to know that you need legal protection to hock your Blues Traveler CDs at a garage sale, you'll be even more surprised to know that a case before the Supreme Court right now could take that legal protection away.
Supap Kirtsaeng, a grad student at USC, was sued by textbook publisher John Wiley and Sons after he sold eight foreign editions of their textbooks on eBay. See, Wiley and Sons sell their textbooks overseas at well below the anal-rape price point that most textbooks are marketed at here in the States. Learning from a grossly inaccurate history book that Christopher Columbus invented America is only worth $300 if the people you're selling it to can afford to pay that much.
Like these dipshits.
You can pick up the exact same textbooks in Thailand for like two bucks and a copy of Maxim with Alyssa Milano on the cover, though. So Kirtsaeng had family members in that country buy the books at the lower foreign prices and sold them for substantially less than what they'd retail for in the States. He claimed he was in the clear to sell the books under the first sale doctrine. A federal jury in Manhattan disagreed, ruling that the first sale doctrine doesn't apply to products manufactured overseas. Wiley and Sons was awarded $600,000 in damages, which raises an obvious question. How much are they selling these fucking textbooks for?
This might sound like it has nothing to do with you, but as the Atlantic pointed out, that "manufactured overseas" loophole applies to just about everything these days. Your iPad was designed here in the U.S., but it was manufactured overseas.
Pictured: A supervisor discusses staffing issues with an employee outside an Apple plant in China.