Instructions
Visit Lon Lon Ranch in the middle of Hyrule Field as young Link. The Ranch appears as a circle on the Hyrule map. Once inside, run inside the coral. You'll see a girl tending to a small horse. Press "A" to talk to her. Eventually, she'll refer to a song. Stand as close to the girl as possible and equip your Ocarina. She will teach you Epona's song.
Exit Lon Lon Ranch and return as adult Link. You will see a gate blocking the entrance to the corral and a man named Ingo standing in front of the gate. Talk to Ingo and pay 10 rupees to enter the corral. Equip your ocarina and play Epona's Song. Epona will run to you. Mount her by standing to the side of the saddle and pressing "A" on your controller.
Position Epona in front of Ingo, who is now inside the corral. Talk to him and choose the "I'm done" option. Talk to him outside the corral and pay 10 rupees to ride Epona again. Mount Epona and stand in front of Ingo.
Talk to him and agree to race him for 50 rupees. The race consists of one lap around the outside of the corral. Press "A" to use one of the six carrots at the top of your screen and increase Epona's speed for a short period of time. Once you use a carrot, it disappears. Keep Epona to the inside of Ingo and you should win without much trouble.
Talk to Ingo again and agree to another race. The race is a mirror image of the first one, although Ingo's horse appears to run faster. Start out on the outside of Ingo. Use four carrots and swing back to the inside. Wait for four carrots to regenerate and use all four of them, leaving yourself with one. By this time, you should lead by at least one horse length. Wait for three carrots to regenerate and use them immediately to finish the race, after which Ingo will refuse to let you leave.
Jump over the wall on the northern side of Lon Lon Ranch by running toward the wall and using two carrots just before you reach it. Epona will leap over the wall and back into Hyrule Field.