The Team Rocket boss leads with Dugtrio, an evolved Diglett. It’s rather speedy, so be cautious. For attacks, it has Earthquake for STAB, Sucker Punch to sneak in an early attack, and Slash. You can go for the standard Water, Grass or Ice, or try and wall it with a Flying-type.
Next up can be Rhydon, which is an evolved Rhyhorn. It’s weak to Ground, Ice, Fighting and Steel, and doubly weak to Grass and Water. It can use STAB Earthquake and Rock Slide, plus Megahorn. Water and Grass are the way to go, but non-Poison Grass-types should be wary.
Nidoqueen is a fully evolved female Nidoran. It’s weak to Water, Ice, Ground and Psychic. This one can use Earthquake for STAB, Crunch to hurt Psychics, and Super Fang to halve your current HP. That leaves Water, Ice and Ground as the safest choices.
Finally, Nidoking is a fully evolved male Nidoran. It has the same weaknesses as Nidoqueen. This monarch has two STAB moves: Poison Jab and Earthquake. It also knows Megahorn, and carries Horn Drill to gamble for a one-hit KO. Likewise, try to stick to Water, Ice or Ground.
Topple Giovanni and he’ll be forced to give you his Earth Badge, as well as TM41 Earthquake. This is the strongest Ground-type move, and it can also hit all targets during Double Battles–that includes your ally, mind you. Afterwards, exit the Gym by using the right-facing arrow tile. Outside, you’ll run into Blue, who tells you where to go next.