Yes, do both. To avoid squeaks, use screws (not nails) everywhere for the flooring.
I had a very squeaky kitchen and entry-way floor, which I wanted to tile over. I kept the existing plywood subfloor but screwed it down to the joists using drywall screws. I used a LOT of them, one every 4 inches or so along every floor joist, and it eliminated all of the squeaks.
Then we put down Hardibacker-type cement board and screwed it to the subfloor. We didn't worry about screwing the cement board to the joists; just screwed it to the subfloor.
That was two years ago. No tile has cracked or shifted, and no squeaks have returned. Definitely use screws and not nails.