Upvote:2
If trip is in one booking:
Show both passports at check-in at the Canadian airport (whilst telling the staff you're going to Brazil via the US), then your Canadian passport at the boarding gate in Canada, and then the Brazilian passport at the boarding gate in Chicago.
If trip is in separate bookings:
Show your Canadian passport at check-in and the boarding gate at the Canadian airport, and the Brazilian one at check-in and the boarding gate in Chicago.
If doing the same trip back:
Use the Canadian passports at both check-ins and boarding gates, and only use the Brazilian one at Brazilian border control.