People in China, like other people around the world, used human poop to fertilize their fields and grow more food. In this picture, you can see a system where when you wanted to go to the bathroom you climbed up the stairs and then the poop fell down through a hole into a cesspool near the pigpen where the pigs ate the poop and converted it into food - this was efficient, but sometimes spread diseases.
Beginning around 500 BC, in the Eastern Zhou Dynasty, rich Chinese people who lived in cities began to have latrines in their houses. These toilets didn't have seats; they were a hole in the ground with two bricks to squat on. Most people didn't have latrines in their houses and they just went to the bathroom squatting right in the street (like in Ancient Greece or Rome at the same time). To wipe themselves, they used straw or leaves or broken pieces of pottery.
People in Rome were building public toilets by about 100 BC, and by 700 AD, as more people lived in cities under the T'ang Dynasty, business people in China began to build pay toilets. These toilets were mud-brick privacy shelters for one person the size of a bathroom stall today, with a hole in the floor to squat over. Businesses collected the poop from these pay toilets and used donkey carts to pull cartloads of poop out to the country, where farmers bought the poop to spread on their fields. Businesses made a lot of money selling poop, but using human poop on fields spread dysentery germs.
Most city people didn't want to pay for toilets. They used chamber pots in their own houses, and then carried the dirty pots to the river to clean them. Sometime around 500 AD, rich people in China began to use toilet paper to wipe themselves. Most people could not afford fancy toilet paper and went on using whatever was handy.
By about 1000 AD, the Song Dynasty government also built free public toilets in big cities to keep things cleaner. These public toilets also sold their poop to farmers for fertilizer. But there were only a few public toilets, and often there was a long line of people waiting to use the toilets in the morning.
Science in Ancient China, by George Beshore (1998). .
The Joy of Pi, by David Blatner (1999). It's not all about ancient China, but some of it is. For teenagers.
Ancient China: 2,000 Years of Mystery and Adventure to Unlock and Discover (Treasure Chest), by Chao-Hui Jenny Liu (1996). Lots of activities , including a Chinese calligraphy set.
Zero: The Biography of a Dangerous Idea, by Charles Seife and Matt Zimet (2000).