Chapter 8: Sootopolis Gym
Exit the Mossdeep Gym for a dialog with Steven and others. During the dialog - Steven gives you the HM07 Dive and the Devon Scuba Gear. Head out of the house and continue south. Use Surf and go south to find Route 127. Continue along it to the south to find Route 128. On Route 128 will be a circle pouch of land with water in the center. Use Dive to the south of it. Now enter the Seafloor Cavern.
Head back to the surface inside the Seafloor Cavern and head north through the door. Continue along the northern route, use Strength to push the boulder in the hole, and continue north through the door. Travel west and north through the door. Surf into the water and use the north bound currents. Continue going north until you cannot anymore. Now go through the northeast door.
Go north and push the boulder east. Continue north and go east. Fight the trainer and continue north through the door. Push the right boulder east into the hole. Now push the northern boulder west. Go north and push the next boulder south. Now go east and push the northern boulder north into the hole. Continue north through the door. Travel around the next room and into the cave in the center.
A dialog will happen between Team Magma and Team Aqua. Travel north and prepare for a battle with Aqua Leader Archie after a short dialog. Once the battle is over - another long dialog will ensue. Now head north along Route 128 to Route 127. Now continue north and go west to Route 126. Continue west to find a large island. Go to the south of it and Dive. Enter the cave to find Sootopolis City.
Surface to the top and go northwest to find land. Go north and you will eventually find a dialog with Steven. During the dialog - you will get the Aqua Suit from Team Aqua. After the dialog - head north into the building, which is the Cave of Origin. Go north and through the first door. Go north again and head east at the most northern spot to find the next door.
Cave of Origin
Head around the next room to find the next door. Continue north to find the next door. Now continue south and go through the next door. Continue north for a dialog with Kyogre. After the dialog - go north and target Kyogre for a battle. It would be wise to capture the beast at this time. Once the battle is over - a dialog will happen with Brendan/May and Steven. You will get the Blue Orb from the Team Aqua Leader.
Steven will give you the Eon Flute. Now head south back into Sootopolis and go to the Sootopolis Gym. The puzzles in this Gym are the ice floors. You must step on each tile once without stepping on any twice or it will break. There are 3 ice puzzles in the Sootopolis Gym. After completing them - prepare to battle with the leader of Sootopolis Gym: Wallace.
Gym #8 Sootopolis Gym - Leader Wallace
Leader Wallace is the head of Sootopolis Gym. His Water-type Pokémon are strong, but share a weakness to Grass-types and Electric-types (bar Whiscash). The puzzle leading up to Wallace is by far the most difficult of any gyms so far. You'll need to step on every ice tile once (and only once) in each of these progressively larger areas. There are multiple path options you can choose, a good strategy is to make sure you don't cut off your path to the north and remember you can cut diagonally to another tile. A strong Grass-type Pokémon (choosing Treecko pays off) will make easy work of Wallace's team, and a good Electric-type will also be effective if you bring an alternate for Whiscash. Remember that he will heal his Pokémon if you give him the chance.
Wallace will award you with the Rain Badge and HM05 - Waterfall which you can also use outside of battle. Now that you've collected all eight badges, all Pokémon will obey you.