You get the HM surf on "Pokemon Emerald" by beating the Gym Leader in Petalburg City. After defeating the Gym Leader, visit Wally's House, where Wally's family gives you HM-03, "Surf."
To get the HM Surf on "Pokemon Emerald." you need to complete the Petalburg City Gym. Fortunately, the Petalburg City Gym isn't very difficult. While some gyms require puzzle solving, this one only requires defeating the various Pokemon Trainers and then the Gym Leader. There are seven trainers to fight, including the Gym Leader. All of the trainers in the gym use normal-type Pokemon, so using fighting-type Pokemon should make finishing the gym battles quite easy.
However, the challenge here is that each of the rooms has a trainer that specializes in a certain attack. They are each labeled as follows: One-Hit KO Room, Accuracy Room, Attack Room, Defense Room, Speed Room, and Recovery Room. Be prepared to counter these specialties.
Once you have defeated all of the trainers in the gym, you encounter Gym Leader Norman. Norman has four Pokemon: a level 27 Spinda, a level 27 Slakoth, a level 29 Linoone, and a level 31 Slaking. Again, all of these are normal-type Pokemon that are weak compared to the fighting-type.
After defeating Norman, you earn the Balance Badge and TM-42, "Facade." Once you complete the gym, you can visit Wally's house, located just to the left of the gym. Here, Wally's family gives you HM-03, "Surf."