I agree with Mae P. My baby got teeth around 4 months, and she started to bite me. I read in a LLL book that the best course of action is to pull the baby into your breast so that the nose and mouth are covered. Then, the baby has no choice but to open up his/her mouth and let go. If you do that each time the baby bites down, he will associate the gasping for air with biting. You can also say, "Don't bite," when he comes off the breast to reinforce things, but I doubt that really will do anything.
My baby only bit down a couple of times, and she stopped after only doing this twice.
It may sound violent (cutting off air supply), but it isn't. It's very quick. Your baby will not suffocate. He probably won't even cry. It's also the least painful way to get a baby off your breast if he is biting down.
My baby is now 14 months old, and she just weaned at 13 months with practically a full set of teeth. It can be done!