Depends on how the list is set up, we sometimes rank as high as 3rd in population - and believe me it's nothing to brag about. Thankfully those crafty Chinese and Indian blokes have been diligently working to keep their numbers up!
The City itself has around 11 million people, the surrounding Metro area takes that up to 18 to 21 million, depending on which cities are counted.
Jeremy is correct - São Paulo is like any major urban area in the world, just like New York, LA or London, there are areas that are 1st Class, and there's areas you need an armored car to drive through. When I first arrived here 11 years ago the MONTHLY minimum wage was R$150, which at that time was worth about US$47. Many poor people worked 44 hours a week for that. Now it's R$540, now currently worth US$320. Many people still work for that. But 11 years ago 80% of the wealth was in the hands of 20% of the population. The Lula years have lifted a huge percentage of the population out of poverty (what they refer here as Class R and D) into middle-income levels (Class C and B).
We are blessed to be considered Class A ourselves, but we're certainly NOT rich, more so solidly upper middle-income by American standards. But the highest class - AAA - still controls a huge amount of wealth. Things have made the first steps towards balancing out, but the imbalance didn't happen overnight either. For those who can afford it, there's every luxury item that can be found here - SP has more than 40 major malls and twice that many smaller ones. We have a mall that you can't walk to - entrance is only by car or helicopter, which limits the type of customers who will visit. On the other hand there are favelas here in the city, visible from the freeway, where their homes are built of scrap lumber from shipping pallets and scrap metal. Power is stolen from power lines, and they regularly catch fire and burn to the ground. It's a constant never ending battle to build them housing, with no end in sight.
The roads are horribly clogged - we hit 6 million cars registered inside the city last year. The bus system is caotic, the metro system too small and overcrowded (they fit an average of seven people per square meter...obviously not when I'm on it...) - 2.5 million people per day ride on only 54 kilometers of line (finally the first new line is opening this year). There is a huge fleet of helicopters here to avoid the gridlock, they made 70,000 flights over central SP in one year, compared to the 11,000 landings at London's Battersea heliport over the same time period.
Infrastructure is lacking, of course. We live in an older but very nice high-rise condominium downtown on a good street. But there's still garbage on the street and homeless people sleeping on the sidewalks. Five blocks away is a large area dubbed 'Cracklandia' for obvious reasons, although they are redeveloping downtown here, much of it remains a bit ratty and decayed,and I'm not just referring to the hookers, hustlers and rent-boys that line the streets after dark. But there's also so fantastic things here too. The largest number of people of Japanese ancestry outside of Japan live here, a huge number of Italians, Portuguese, Lebanese, and Jews made this home, so it's a very cosmopolitan city too.
Actually, the areas hit by the slides were 40 miles from Rio, they were towns in the mountain area there. Here in SP some of the flooding and smaller slides have indeed been in the favelas, as they are usually built in unapproved fashion, many of then squatting on unoccupied land, much of which is along stream and on hills.
Sorry, didn't mean to offer a complete lecture!