Before you ever teach a horse any trick....especially rearing....it's very important that you already have a horse that is very well broke.That is...that the horse understands 100% that when any pressure is applied (be it lead line or rein) that the horse gives (yields) to that pressure.
If the horse has any tendency to resist, then that needs to be addressed first.
As it's been said here....rearing is dangerous partly because you're teaching a horse to balance himself on his hind legs, and because unless you really know what you're doing and your timing is good enough....and you know and understand that you must have a pattern set up so there's a definite cue to mean rear up....you can accidentily cue your horse to rear and get hurt or get the horse hurt.
The trainer that taught me how to teach a rear up, taught his horse to rear from the ground. Well, guess what? When he cued him from the saddle for something else (not rearing) the horse reared by accident. So, doesn't matter if you only teach the horse to rear from the ground, he may still rear up under saddle.
You'll be turning the rear up into a cue. It's now an option for the horse to find a release of pressure. It's one option other than go forward, back up, stop, turn left or right....he can say, "do you want this?" and rear up when you don't want him to.
Which is why it's a good idea to have a trick horse and have a riding horse. Don't make your riding horse your trick horse, unless you are okay with riding a rearing horse. If that doesn't worry you at all, then by all means, teach the rear up (if the horse and you are ready).
I'm not going to post here how to do it, but I will direct you to a trick trainer named Allen Pogue who has a DVD out about rearing: http://www.imagineahorse.com