A copy machine in a libarary is legal because of fair use. You can legally copy small parts of copyrighted works (In the US). Generally, but not always, this means 30 seconds of music can be copied legally, and a couple pages. Note too that many people use a copy machine for things they own rights to (their tax returns for instance). For that matter not everything in a library is copyrighted, some old books are out of copyright.
As for WinMX... Well you need to figgure out EXACTLY what you are copying with it, and then see a lawyer.
Best: even if it is legal, buying a copy supports the artists you like. If it isn't worth buying a copy, then why clutter up your computer with music you don't like?