You should do both.
The reason is that there are several things one has to learn at the same time when working to improve on an instrument. It's important to learn musicianship and new techniques, and it's at least as important to learn ergonomics, proper posture and form, etc.
You should get some fairly simple, short pieces loaded into your muscle memory that you can play without thinking about them and use them for warm-up. When you start a practice session, play through some of those for 5 or 10 minutes while focusing on relaxation, posture, form, tone, and any weaknesses you might have. These are also good pieces for playing with a metronome to work on timing.
Other great uses for simple pieces that you can play easily are learning difficult key signatures by transposing them into those keys and relearning them, as well as changing the feel and relearning them. For instance, I have a Bach minuet that I've been playing for more than 30 years that is quite simple for me, so I play it straight sometimes just to relax, other times I change the key or play it with swing (NB pianists: if you haven't "jazzed up" a Bach or Mozart minuet before, you don't know what you're missing) or play it entirely staccato or with exaggerated legato, etc.
Of course, you're not going to keep learning if you only play simple pieces that you know by heart over and over again, so you certainly have to challenge yourself. Piece selection is one area where teachers provide a lot of value. Until you start working on a piece, it's hard to know whether it is an appropriate challenge or way beyond your abilities. I've been overly ambitious with learning pieces way beyond my abilities and gotten away with it, but it is dangerous in a few areas.
Working on excessively hard pieces can encourage you to try to learn techniques that can cause injury if repeated incorrectly and frequently. Also, working on overly difficult music can sap your morale and take away from the joy of music.
If you insist on doing piece selection on your own, I would look for an anthology or series of books where the pieces get more and more difficult. I'm thinking like the Suzuki method books (I'm not sure if they make them for guitar). With a resource like that, you can find approximately where you are in the difficulty spectrum and start working on pieces that are just past that.
Short of that, you should look for as much literature as you can find (http://imslp.org is a resource) and play the first several measures and see if you can judge how much it interests you and how much it challenges you. You want to find pieces where you can see how to play almost the whole piece, with one or two challenging areas for you. Using classical literature, you might look for pieces called etudes, since they are specifically written to be educational.
I think most people can teach themselves music, but it takes much longer and exposes one to many pitfalls compared to having a teacher. Only you can decide what route is best for you and your wallet, but if you haven't already learned one instrument in a structured way, trying to learn an instrument while also trying to learn how to learn an instrument is an overwhelming challenge.