I tried to install a new water heater at home. When I removed the old pipes, I found there's a black deposit in the interior of my copper pipes (both cold water pipe to water heater and hot water pipe from water heater). I tried to rinse it out and used bleach, but the black layer on the interior of the pipe did not come off. Do I need to replace all the pipes in my home, are there health issues that associates with this?
You may notice a rotten egg odor from the water from time to time if the sulfur content is high enough. Bacteria in the water convert sulfur compounds into hydrogen sulfide which reacts with the copper to form a coating of copper sulfide.
There are no set limits on how much sulfur can be in the water. It's naturally occurring and not considered to be a primary water contaminant.
If you are having problems with slime, stained clothes or rotten egg odor, chlorination can reduce the bacterial action that produces hydrogen sulfide. Chlorination will cause the sulfur to precipitate out of the water which you will now have to filter to remove the particles.
Excessive sulfur content in water has a laxative effect, probably the only reason to worry about it. Lower content is basically an added nutrient. Hydrogen sulfide gas in quantity is a poison, but since it's smelly and you haven't mentioned it, the quantity is likely a non-issue.
As to the pipes, it sounds like your problem is a stable black copper sulfide tarnish that has low solubility in water (unlike copper sulfate which readily dissolves and is toxic). New copper will quickly acquire the same coating from the hydrogen sulfide (which will also tarnish silver).