Instructions
Play through the game until you have collected the first three gym badges and have traveled to Ecruteak City, where you must get the fourth gym badge. Enter the large building to the northeast of the Pokemon Center.
Go onto the stage and speak with the Team Rocket member to start a battle. When you defeat him, everyone will be very grateful. Speak with the man in the audience, and he will give you HM 03, Surf.
Go to the Ecruteak Gym and fight your way through the gym's trainers until you reach the end of the walkway. Each trainer's light goes out once you beat them, so the path becomes obscured. If you fall off the path, you are warped to the beginning of the gym, but all the lamps will be relit; you won't have to fight the trainers a second time if this happens.
Make your way through the gym until you reach the end of the walkway and face off with the gym leader, Morty. Once you defeat Morty, you will be allowed to use HM 03 on your Pokemon to teach them Surf.
Go into your inventory and flip through the options until you get to the "TMs &HMs" section. Select "HM 03 Surf" from the list and you will be given the option to teach your Pokemon to surf. Pick one of your Pokemon -- it has to be a Water-type Pokemon -- and press "A" to teach it to Surf.
Approach a body of water and press "A" to interact with it. A message will pop up and ask if you want to use Surf. Select "Yes" and you will be able to move across the water.