A lot of people teach themselves and end up making music history, but like anything it's possible to pick up bad habits and if someone is watching you learn who knows what to look out for it can save a bit of re-learning later. The best drummer I know was shown how to sit properly after she had been playing for over a dozen years, meaning she was more stressed than she had to be for all those years because of her body posture. It is, however, possible to work out music theory by ear. I had one guitar teacher who was self taught show me a variation on a blues scale he had worked out which was in fact a Dorian minor scale, however had he had a teacher he may have learned this earlier in his career. Music theory is, after all, just rules people wrote down because they sounded good when played.
Many guitar books have only the melody line and chords, without the guitar solos or anything else. The way to work out solos is by ear, possibly assisted by watching peoples hands on TV/music videos. Before that you want to be familiar with the neck of your guitar though.
The first thing to do after you've learned a few chords is to learn the scale shapes on the neck of your guitar (some people who know more than me often do things differently, but this is how it worked for me). Any major shape in the first position is the same in any key, likewise in the second position (which is the first position of the Dorian mode) etc. For example if you work out C major starting on the 6th string 8th fret, using the 7th-10th frets and working across the neck of the guitar (2 octaves):
The C major scale in position C in the diagram.
The diagram is of C major scale to the 13th fret, but as frets 12+ are the same as from the top nut up except up an octave, the 13th fret is the same as the first fret and so on. The following discussion assumes you are playing ascending scales which go from left to right on the diagram or from the top down on the neck of your guitar (provided you're right handed), from the 6th string to the 1st string. The notes are marked 1-8 for the 1st through 8th notes of the C major scale, the 8th note being the 1st note up an octave (hence marked 8/1 everywhere except on the 6th string).
The second position (9th-13th frets, marked D) is still C major if you start on the 6th string, 8th fret (again) and slide straight up to frets 9-13, or if you start on the 4th string 10th fret, but if you start on the 2 note you are playing D Dorian in the first position. Try playing 2 3 4 5 6 7 8/1 2, then playing 1 2 3 4 5 6 7 8/1 evenly a few times and the sound should have a different feel.
You can transpose this diagram into other keys by re-numbering the fret positions, for instance if you play the same shape as position C but from the 2nd to 5th frets you are playing G Major, playing from the note marked 1 on the 6th string (which you now play on the 3rd fret, which is the note G) to the note marked 8/1 on the 1st string (which you also now play on the 3rd fret, another G note). You start on the 3rd fret but play on the 2nd fret on the 3rd and 6th notes, which are on the 2nd and 3rd strings, and on the second time you play the 2nd and 7th notes, on the 3rd and 1st strings (remember going accross the neck of your guitar takes in 2 octaves).
If you play the same shape as position D starting on the 6th string 5th fret you're playing an A Dorian minor or G major in the second position. This involves playing the pattern marked D in the diagram from the 4th-8th frets but starting at the 5th fret instead of from the 8th-13th frets starting on the 9th fret.
I have found a knowledge of the major scale in every position (hence all the modes) has helped me immensely. It makes it very easy to work out different ways of making chords. If I see G major and know all the places there is a G major scale, I can see several different ways the chord can be played. If I know all the positions of the Major scale then I already know the Dorian, Myxalidian or Dominant 7th scale (4th position of the major scale) and Natural Minor or Aeolian (5th position). This gives me four commonly used scales that I can play all the way up and down the neck of the guitar in one go from learning this one pattern.
The modes are Ionian, Dorian, Phrygian, Lydian, Myxalidian, Aeolian and Locrian respectively. The Ionian mode is another name for the Major scale, the Aeolian mode is another name for the Natural Minor scale and the Myxalidian is another name for the Dominant Seventh scale. In the diagram, playing 1-8 is the first position of C major/Ionian and is marked C in the diagram, 2-2 (ie 2 3 4 5 6 7 8/1 2, marked D) is D Dorian (a minor scale), 3-3 (marked E) is E Phrygian, 4-4 (also marked E) is F Lydian, 5-5 (marked G) is G Dominant Seventh/Myxalidian, 6-6 (marked A) is A Natural Minor/Aeolian and 7-7 (also marked C) is B Locrian. Having said all this, knowing the names of the modes is actually pretty useless.
I have worked out other scales in all their positions by drawing the neck of my guitar for each scale and marking down all the notes that occur in that scale everywhere on the neck of my guitar.
If you get very familiar with the scales and the neck of your guitar it will help in playing from musical notation/tablature and working things out by ear (you've got a starting place and a better chance of being able to play what you're hearing).
Once you can play straight scales in any position, work out variations (eg 1st 2nd 3rd 4th 2nd 3rd 4th 5th 3rd 4th 5th 6th etc). A lot of exercises for other instruments will transpose directly across to guitar in case you have experience with another instrument.
One exercise that is for guitar is to play the 1st 2nd 3rd 4th frets on the 6th string using your 1st 2nd 3rd 4th fingers (on your left hand if you're right handed) respectively, them repeat on the 5th, 4th, 3rd 2nd and 1st strings. After repeating that for several minutes (go for smoothness and no mistakes, speed will come later), go 1st 2nd 3rd 4th, 2nd 3rd 4th 5th, 3rd 4th 5th 6th, 4th 5th 6th 7th etc frets all the way up the neck of your guitar on the 1st string using your 1st 2nd 3rd 4th fingers. That is, 1st fret 1st finger...4th fret 4th finger, 2nd fret 1st finger...5th fret 4th finger etc. Then go 12th 11th 10th 9th, 11th 10th 9th 8th, 10th 9th 8th 7th etc down to 4th 3rd 2nd 1st using your 4th 3rd 2nd 1st fingers (starting at the last fret you can reach comfortably on your guitar rather than the 12th fret). This is also a good exercise to practice your picking technique. Make sure you alternate between down strokes and upstrokes with your pick (ie down up down up etc). You should also do this when playing scales if you want to develop speed.

The numbers to the right of the guitar neck are fingerings on the first string.
Using a pick: hold the pick between your thumb and 1st finger, sort of making a five pointed star (your thumb and forefinger cross over slightly and the pick sticks out a bit, so it's more like an X with a short stem coming out one side). Try and get a look at what any decent guitar players whose hands you can see are doing (note some good players have some bad habits, so check more than one). You're arm rests on the guitar near your elbow and the action is in your wrist. You can practice just flicking your wrist back and forth on the end of your arm. Your arm should not move up and down. It's sort of a rotary action.
Once you've got your picking technique happening and your hand knows where the scales are, start playing along with records, the radio or whatever. Ways of learning riffs - copying them by ear, watching very closely if you get the chance to see a guitarists hands, having someone write them down for you (something teachers do a lot of) and getting guitar magazines. You never know what you'll be able to find in the library either, there are books with all kinds of riffs and techniques in them (but they're no where near as common as books with just the melody line and the chords).