Unhappiness will always rise with population. The only way to fight it (while keeping the benefits of that population) is to keep adding happiness so that your happiness is always a little higher than your unhappiness.
If you trade commodities aggressively, you can get tons of happiness bonuses from resources, with buildings like the market adding extra happiness from certain commodities. Around mid-game I like to build theaters and colliseums and set my culture slider to 20%, which usually quells any remaining unhappiness, at least during peace. Jails help with prolonged war unhappiness, but the best way to deal with that is to take breaks from war between conquests. If you've still got unhappiness with all that, you can experiment with your civics. For example use organized religion to promote a few religions in every city, build temples for all of them, then switch to free religion, for a big happiness bonus.
In reality, big cities all have multiple sources of entertainment and luxury for their residents, and the population would get pretty frustrated without such outlets. People in smaller towns dont have access to as many different entertainments and products, but they accept the tradeoff for the lack of problems in a city.