'To get Mew, the legendary Pokémon, you have to beat Red, a.k.a. Ash Ketchum, on Mt Silver. You then have to get the three legendary dogs: Raikou, Entei, and Suicune and capture Mewtwo, before heading to the Embedded Tower. Mew should then be there.
To get Mewtwo, you need to have two Nintendo DS handheld consoles; one with Heart Gold and one with Soul Silver. This is because only one of the three dogs is on Heart Gold, and one is on Soul Silver. Once you have two you need to speak to Professor Oak. He fills you in on the rest of their legend, and gives you a Jade Orb and sends you back to the tower. There you will find the final dog. From there you head to the Cerulean Cave, in Misty's town. Go through the cave and once you come out the other side you will find Mewtwo.
There are two ways of capturing Mew, or any other legendary Pokémon for that matter. The first option is to use Action Replay to keep attempting capture versus the Pokémon. Alternatively you can use Action Replay to generate Master Balls, which mean you instantly capture any Pokémon you wish - including Mew.
If you don't wish to go through the process of in-game acquisition then there is an alternative. Using WiiWare 'My Pokémon Ranch', and either Pokémon Diamond or Pearl on two DS consoles, you can trade Mew. Meet the conditions with Hayley in the WiiWare ranch and you receive Mew. This is only compatible with Diamond or Pearl. You then simply trade Mew to Heart Gold.
Contrary to belief, you cannot breed Mew. Mating a Mew or a Mewtwo with each other or with Ditto at the Breeding Centre does not generate Mew eggs, or any other legendary creation. Legendaries cannot breed, and their existence is ultra rare, so don't believe that game makers would overlook such a loophole you can get mew from a egg.