To teach yourself how to play guitar, start by learning the five basic chord shapes: G, C, D, E minor and A. Refer to a guitar tablature on how to finger these chord shapes correctly. Keep practicing them until you can shift from one chord to another seamlessly. If your fingers start to ache, rest for a little bit until you are ready to play again.
Practice strumming the guitar along with a metronome. Strum your guitar in a downstroke manner with your right hand in time with the clicks. Keep strumming the guitar until you are on the beat. Start slow with the metronome at 80 beats per minute, then increase the tempo as you improve, or introduce more upstrokes and downstrokes in between beats.
Once you are comfortable with strumming, play the five chord shapes with your left hand as you strum along to the metronome. Start slow, and keep practicing until both your right and left hands are in time with the beat.
After chords and strumming, start looking for guitar lessons of your favorite songs online. You can choose video or tablature lessons. Youtube.com is a good source of guitar lessons for beginners, while good tablature sites include WorldGuitar.com, JamCenter.com and 911GuitarTabs.com.