There is quite a lot of things to do here in Mossdeep City. Heal your Pokemon now, and maybe visit the Mart. On the raised land in the eastern part of the city is a Fisherman's house. Talk to him, and he'll give you a Super Rod. Then go into the Space Center (the large green building), and talk to the first person you see. He'll give you a Sun Stone. Then you can go to the house in the upper-left hand corner of the city. It's Steven's house. He'll give you HM 08 - Dive. With this, you can dive underwater. But before you can use it, you must get your seventh badge.
This is a Psychic Gym, so be prepared with something that you think can defeat powerful Psychic Pokemon. Step on the triangles on the left side of the room. You will automatically be moved in front of a trainer. Next, move one space up and one space left onto more triangle. These take you a long way, and you'll fight another trainer. Next, walk one space down and three spaces to the right, which will lead you to another trainer. Press "A" to the switch (box shaped device), and head down. Go down onto the next set of arrows. Then up onto a set of arrows. Move one space up, one space left, and one space down. This will bring you to another trainer. Flip the switch, and ride on the very first set of arrows again. This will put you in front of a trainer. Step on the arrow to the left of where you are, and you'll fight another trainer. Flip the switch, and go back to the beginning. If you did everything right, then you will be able to ride all the way to the end, where you'll meet the twin gym leaders.
They're Tate and Liza, and they're ready to battle with a lv. 42 Lunatone and a lv. 42 Solrock. Of course, you'll be forced to send out two Pokemon. The two weird looking Pokemon are quite hard to defeat, so be careful! For winning, they'll give you TM04 - Calm Mind. The Mind Badge is also yours. It enhances the Special Attack and Special Defense of your Pokemon, and lets you use Dive outside of battle. Get out of the gym by stepping on the teleporter, and getting out of the gym. Now it's time for some diving!
Heal your Pokemon and exit the city by taking the second staircase south of the city. Surf until you see dark waters. Now you can dive underwater. It's a lot darker down here, as you can see in the screenshot. Follow to path down until you reach a cave with a submarine in it. Enter the cave and resurface by pressing "B". You'll be at the Seafloor Cavern when you do resurface, and a difficult puzzles awaits you after the entrance.
The first thing you'll see are some boulders. Push them away using Strength, and keep on going up. In this next chamber, move the rocks around to get to the entrance to the left. Surf up, then right, then right, then left. Get onto the land, and enter the entrance. Try to get through all the boulders, and a Team M/A Admin will challenge you to a battle. Continue by going on to the next chamber, where the hardest puzzle lies.
The hardest puzzle really isn't that hard, so getting through it shouldn't be a problem. After getting through that, continue on, and you'll find TM 26 - Earthquake. Go all the way down. You'll see the sleeping Groudon (for Ruby)/Kyogre (for Sapphire). There, you'll fight Team M/A's leader. After defeating him, the Reb/Blue Orb will glow, and the legendary monster will come to life! You will be taken outside, where the weather changes according to the version you own. In Ruby, there is a strange dry, shining effect all over Hoenn. In Sapphire, there are thunderstorms. In addition to that, all towns' and routes' music have been stopped. Steven will come to talk to you, and will leave. After that, head north, and then west. When you get to the dark waters of Route 126, dive into the sea. In order to put the world back in peace, you must catch Groudon/Kyogre!
It looks a bit different here. To battle an underwater wild Pokemon, go through the seaweed. You'll find many dark circles underwater. They turn out to be hidden items. As you continue to explore, you'll notice a large piece of land in the water. Go to the very south of it, and go into the cave. Resurface, and you'll be at Sootopolis City.