After you defeat Gohma, the Deku Tree asks you to complete a new task.
Listen to the Deku Tree's Tale
During the cut scene, say Yes to listen to the Deku Tree's story. (If you say no, he will keep asking you until you say yes.)
Go back into the Kokiri village. Talk to Mido to make him move out of the way. Exit the forest through the hole at the far end. There will be a cut scene where Saria gives you the Fairy Ocarina.
Go to Hyrule Castle Town
Outside, an owl will talk to you. If you want the owl to repeat what he said, say No. Otherwise, say Yes. The owl will fly away.
Now that you are in Hyrule Field, time will pass. Eventually night will fall, and when it does, Stalchildren will appear out of the ground and attack. They are easy to defeat.
Go all the way across the field to Hyrule Castle. It's at the top of the blue map in the corner of the screen. You might not make it before nightfall, when the castle gate closes. Just wait around outside of the gate killing Stalchildren until day time, then go into town.
Get a Gold Skulltula
Once inside the gate, if it's night time, avoid the dog running in circles.
No matter what time it is, you should go into the guard house near the entrance to town. Break all of the pots to get a large number of rupees, then use a roll attack on the rightmost box against the far wall to reveal a gold skulltula. Kill it and take the token, then leave.
Get a Piece of Heart
If it is night time, avoid the running dogs. Go to the market area (where a girl is singing) and walk behind the stall to the left of where you enter (there is someone looking out of the window above this stall) and walk up to the little white dog. It will follow you. Go toward the right side of the screen and go into the back alleys. Go into the rightmost door and talk to the woman to return her dog and receive a piece of heart.
Get a Second Gold Skulltula
Regardless of whether it's night or day, talk to the girl singing near the fountain in the market area. Then go through the exit at the end of the path that the girl is standing on. After the owl talks to you and flies away, roll attack the tree to find a gold skulltula.
Get the Weird Egg
Go back into town. The singing girl is gone, so go back to the area that you just came from. You will see her there, standing next to some vines. Talk to her to get the Weird Egg. Set it to the X, Y, I, or II button on the 3DS touch screen, or to a C button in the N64 version.
Get into Hyrule Castle
If you didn't get the piece of heart from the dog owner at night time before, wait at Hyrule Castle for night to fall and go back into town to do that.
Then, back at Hyrule Castle, climb up the vines to the right of Malon until you're up on the ledge. Follow the ledge until you reach the top of the arch. Don't walk toward the left side of the arch or the guard will catch you. Don't fall into the hole on the roof of the arch. Instead, jump off so that you land on the ground on the other side.
Next, you have to avoid all of the guards and get into the castle. To do this, walk forward until you see a hill to your left. Go up at an angle, but don't go too far left or the guard there will spot you. Watch out for the two guards on the dirt path down below, and don't get too close.
Then, walk toward the flowers on top of the hill, and walk along the small dirt path, but don't get too close to the guards at the end. In the distance on the left, you will see some bricks in the wall (vines in the 3DS version). Go to them and climb up. Then, staying near the left wall, jump off of the edge to the ground below. Jump into the water and let it carry you to the far corner where you can walk up a slope and get out of the water. Turn left and walk straight ahead to find a snoring guy.
Wait for sunrise for your Weird Egg to hatch if it hasn't yet. When you have the Chicken, use it on the sleeping guy to wake him up. Talk to him. After he runs away, you can pull the boxes. There is a gap where you can push the boxes off of the ledge. Push one off of the ledge, then stack the other one on top of the one that fell. Get on top of the crate and then run and jump to the small drain hole in the wall. Make sure that it is day time, then crawl into the hole.
Get Past the Guards
You must go past the guards without being seen.
First, walk left past the piece of wall that sticks out, but stay near that piece of wall. Hide behind the bushes at the right side of the screen, then go toward the back wall, staying behind the bushes. Wait for the guard to walk away from where you are, then go left and hide behind the bushes in the center. If you are quick, you can go to the left and walk to the next area before the guard starts walking to the left. Or if you would rather play it safe, then wait for the guard to walk in front of the center bushes. Walk to the bottom-right corner of the center bushes, staying behind them to keep the guard from seeing you. Finally, when the guard walks toward the back wall and stands there, run past to the next area to the left.
Go toward the back wall, but stay behind the bushes. Wait for the soldiers to go toward the near side of the screen near the front of the fountains, and walk behind the fountain closest to you. Wait for the soldiers to walk toward each other and face each other, then hide behind the right side of the fountain. When the soldiers start walking toward the back wall, hide in front of the fountain. When they are far enough away, run to the next area to the left.
If you want a challenge, you can try to get the rupees down below. Otherwise, go up the steps and slowly walk across the planks on top. When you reach the other side, jump off and stay behind the lower piece of wall to the left.
Wait for one soldier to be at the far left side of the screen and the other soldier to be above the statue wall (not at the far right, but behind the wall) and run and hide in front of the statue wall, far away from the far left soldier. When the far left soldier walks up toward the back wall, run past to the next area and stay in front of the near bush.
Wait for both soldiers to go up the left side of the passage, then get out from behind the near bush and hide in front of the rectangular bush in the center. Then, when the nearest soldier is all the way at the far side of the bush, go next to the left side of the center bush. Wait for the near soldier to stop at the right side of the screen, then run up and through the arch to the left. You made it!
Get Zelda's Letter and Learn Zelda's Lullaby
Go to the window on the right side of the courtyard and you will see portraits of Super Mario characters inside in the N64 version, or a 3D Super Mario scene in the 3DS version. Use the slingshot on this window to get 20 rupees.
Go to the far wall and talk to the princess. Say that you have the Kokiri Emerald. Promise to keep her secret. Agree to look through the window. Agree to help Zelda.
She gives you a signed letter. When you exit the courtyard the way you came in, Zelda's nursemaid Impa will stop you. She teaches you Zelda's Lullaby and then takes you out of the castle.
Get a Bigger Bullet Bag
Before moving on, walk all the way up one of the chains of the castle gate. When you're against the wall, turn and face the center point above the gate and jump toward the center. You will get a few red rupees. Be sure to hold up on the control stick to roll when you land and not get hurt. You can do this over and over until your wallet is full if you wish.
Now go back into town and go into the target shooting place. Pay to play. The first rupee that appears is green and in the center. Next, a blue one appears a little to the left; shoot that one and another blue rupee appears to the right. Then, another green rupee appears from the center, this time it floats up and then down, so try to hit it when it is going up. Next, two red rupees go from right to left near the top. Finally, two red rupees go from left to right, going more quickly than the last ones. If you win, you get a bigger bullet bag. If you miss just one or two rupees, you get another chance for free. You can keep trying, and can always get more red rupees from above the town gate.
Get Milk at Lon Lon Ranch
Now go back out to Hyrule Field. Go to Lon Lon Ranch, which is in the center of Hyrule Field.
In Lon Lon Ranch, go into the door on the left. Throw all of the Cuccos into the corner at the foot of the stairs. Talk to Talon and play the game. The Super Cuccos are thrown into the three corners away from the foot of the stairs. Pick up any Cuccos near the corners and throw them right away if Talon doesn't say anything. When you win, you get a bottle of Lon Lon Milk. You can keep the bottle after using the milk, which you can use to store fairies and other things. There are two servings of milk inside, and each serving replenishes your hearts.
Find a Gold Skulltula
Go outside. When you go through an archway, look to the left to see a tree. Roll attack it to reveal a gold skulltula.
Learn Epona's Song
Go into the horse enclosure. Malon is in the center. Talk to her until she mentions singing to gether. Get close to her and take out your Ocarina. If she doesn't say anything when you take out the Ocarina, move closer to her and take it out again. She will teach you Epona's Song.
Now that you know Epona's Song, you can get more milk if you find a cow and have an empty bottle with you. Just play Epona's Song for the cow and the empty bottle will be filled with Lon Lon Milk.
Get a Piece of Heart
Finally, leave the horse pen and turn left and walk around the path surrounding the pen. Eventually you'll see a silo. Go inside. Pull the corner crate away from the corner, then climb up on it and jump behind it. Push it away from the wall, then crawl through the hole you revealed to get a piece of heart.
Now you can leave the ranch. By the way, Talon looks like Mario, Malon looks like Princess Toadstool, and Ingo, who is in the stable, looks like Luigi. Also, Malon and Talon have a medallion that looks like Bowser.
Your next destination is the Kokiri Forest. The entrance is in the east side of Hyrule Field, in the middle.