Infringement is when you take someone else's work or idea and use it as your own. Fan fiction would often be considered infringement because you're taking characters that were created by another author. Sure, you can write it for fun in the privacy of your home, but you won't be able to sell it. Note also that just changing a few small details is not enough to make a character or a story your own. There is an exception to infringement, though, and it's called "fair use."
Fair use is what you use when you write an English paper and you need to use quotes in the paper. You're not paying the author you're quoting for the right to use his or her words, but because you're only using a short snippet and you're using it for academic purposes, it's OK.
Derivative Works are any works derived from the original work. In other words, if you own an existing work, you also retail rights to follow-on works in both that medium and other media.
For instance, suppose you own the rights to a novel. You will also retain rights to sequel novels, plays, films scripts and films, audio books and translations of the original (provided you don't give these rights away). This is one place where it can be invaluable to have an agent in your corner. Your agent will help keep you from giving away all these rights when you sign a contract.
Take-home message: 1) Don't use pieces of work you don't have rights to, unless you're certain that you're covered by fair use (i.e. like when writing an English paper). 2) Have any doubts as to which rights you should hold onto? Get an agent.
*In this example, McDowell's is an example of fair use with regard to a trademark, but fair use operates similarly with copyright as well.