Chapter 3: Mauville Gym
Exit the Dewford Gym and head north to Route 106. Head west and go inside the cave – Granite Cave. Travel through the cave until you reach the Hiker. He will give you the TM70 Flash. Now head north and go through the door to find Steven. Steven gives you the TM51 Steel Wing in exchange for the Letter. Head back south and exit Granite Cave. Head back to Dewford and speak with Mr. Briney.
Sail with him to Route 109 (near Slateport). Head north into Slateport and find Stern's Shipyard. Enter it for a short dialog. Now exit and head north to the Oceanic Museum. Enter it and pay the 50 entrance fee. Head north and up the stairs to talk with Captain Stern. A battle will ensue with Team Aqua members. Defeat them and exit the Oceanic Museum.
Head north to Route 110 and a short dialog will happen before exiting the city. You will get the Contest Pass and the Pokeblock Kit. Continue back to Route 110 and go along it while fighting with the trainers. Take the path east at the Trick House and continue down the path. Head north and battle with Brendan/May. Defeat him to get the Dowsing Machine. Continue north and follow the path to Mauville City.
Continue into the city for a dialog with Wally. Follow him north and now take the path east. Enter Rydel's Cycles and speak with the owner for a free Bike. Now head north and to the west to find the Mauville Gym. Battle with Wally and defeat his lvl 17 Ralts. You will get the HM06 Rock Smash from his Uncle.
Now head into the Mauville Gym. Step on both the Blue and Red switches. Fight the trainer and head north. Fight the trainer and press the Blue switch. Continue down the path towards the Red switch. Fight the trainer and press it. Go north and back east towards the second Blue switch. Press it and follow the path north. Fight the trainer and continue north.
Gym #3 Dewford Gym - Leader Wattson
Mauville Gym is an electric-type gym led by Leader Wattson. You can navigate the gym's puzzle quite easily by stepping on the switches that move around electrical barriers. Wattson's Pokémon all have a weakness to Ground type, so Geodude is a good option; if you chose Torchic as your starter it may be a good option as well, since ground types are hard to come by. Be prepared to heal from paralysis and watch out for the Super Potions that Wattson will use to heal just before you thought you'd beat him.
Wattson will give you the Dynamo Badge and TM72 - Volt Switch once you've beat him. The Dynamo Badge allows you to use Rock Smash outside of battle and forces all Pokémon up to Level 40 to obey you.