As for where to stay in Sao Paulo, the best nightlife is around Vila Olimpia or Itaim, but hotels can get pricey. Vila Madalena/Pinheiros is a good alternative, as well as Bela Vista. Brooklin also if you can get good deals. All are relatively safe, although if you stay in Bela Vista be cautious about venturing into neighbouring Centro which has some dangerous streets full of crackheads. Always take taxis at night (download Easy Taxi / 99 Taxis apps to your phone). Can't comment on hostels because I'm not really familiar with them - I suggest you check Hostelworld for reviews.
I think your lengths of stay in each city are good.
I think your lengths of stay in each city are good.