All cheese goes bad, but it all goes bad in different times and in different ways. It is important that you properly care for the cheese that you purchase and store it correctly so that it will stay for as long as its shelf life allows. Cheese that isn't taken care of properly will end up going bad and will be unsafe to eat. If you take care of it, you may be able to get more shelf life out of your cheese and use your mozzarella cheese to the end of the ball, loaf, of whatever other form it came in.
Fresh mozzarella or the buffalo mozzarella has a much shorter shelf life than the other kinds of mozzarella cheese. It is important that you use this mozzarella cheese up as quickly as you can. This cheese has not been aged, so it doesn't have the same shelf life as the ones that have been aged properly. It is important with fresh mozzarella that you use it up in a couple of days. If you see mold on this kind of mozzarella cheese or if you see that it has an odd smell to it, you are going to want to toss it.
If you are purchasing mozzarella like part skim or the whole mozzarella that has been aged and through the entire cheese making process, it will have a longer shelf life. This mozzarella cheese lasts longer because it has been through the aging process which basically helps to create a little more preservation. This cheese will not last forever, but it will last a lot longer than the mozzarella that is fresh. Even with this mozzarella, if you see some mold on it, it is still ok to eat. But, you will want to be sure that you properly remove the mold, which means cutting it out and ensuring that there are no mold spores left on the cheese, it will still be good to eat as long as the mold is all gone.
Long answer short, mozzarella cheese does go bad, but it will last for a while depending on the kind that you get. Your fresh mozzarella is going to go bad a lot quicker than the mozzarella that has been aged. But, with proper storage in an airtight container and proper refrigeration you may be able to extend the shelf life of your cheese. Know when your mozzarella goes bad.