Should I do all the exercises in a textbook?
I would say it somewhat depends on the level, but may be not that much actually. The following is how I did it myself when in self study mode, and no professor to oversee the progress.
As an undergrad, say in vector analysis calculus, I did all the theory problems and enough many of the computational exercise to feel confident that I can do the rest. At that stage if, upon reading another problem, I could see a way to do it, then I wouldn't bother unless the problem had some intrinsic appeal (at the time I didn't know whether I want to major in math or physics, so problems motivated by theoretical or celestial mechanics would often make the cut).
As a beginning grad student it was more or less the same way, but as the exercises were largely theoretical I ended up doing most of them (they were fun actually). Later on it depended. If I only needed to get a general idea of the material, or felt eager to get to the next chapter, I would only a few exercises and try to move on. If I skipped too many of the exercises I would start feeling rather lost a few chapters further down. Then it was time to try the problems in the preceding chapter. If I couldn't, then I would go back to the preceding chapter, and so forth. Doing this iteratively worked quite well for me.
Of course, some more advanced textbooks don't have exercises. Then you need to make them up yourself and otherwise apply whatever habits have worked for you in the past.
The preceding paragraph is kinda my main point. You need to find a way that works for you. Lower level textbooks offer more repetitive work, and you can cut some of that. But at your own peril!
You don't necessarily need to do all problems in your textbook, but you need to make sure that you can do them. This usually involves doing a reasonable sample to test yourself.
The exercises I explicitly give my students in their assignments are a minimal sample, and I always make it clear that they are not enough to master the subject. I also tell them what it means "to be able to do an exercise": it means to be able to do it without help, without looking at the textbook, in a reasonable amount of time, and correctly. I have learned from extensive experience that the last sentence is not obvious to a lot of university students.
Of course, the more advanced the course the less the previous paragraph applies. For more sophisticated subjects the exercises tend to be more complicated, and not just a direct application of the topics considered.
Uh,you paid for all of them,so why not at least try them all? Or as many as time allows.
I'm only partially being sarcastic here. We learn mathematics by doing mathematics.This is particularly true of analysis, where the concepts and methods are creative and require some ingenuity in attack. And that means developing experience with solving many different kinds of exercises, from routine computations to difficult proofs. You can read 100 books from cover to cover and have total recall-and I can garuntee you won't be able to do more then pass a standard exam without working at least some of the exercises.
My advice-do as many exercises as time allows. Also-if the exercises are asking you to just do tedious computations and/or restate definitions-then chances are you're not using the right book. If an exercise doesn't make you think about the question for at least a minute before you begin attempting to solve it,then it's going to be a useless exercise to do. Period.
And in closing-Pugh's book has a truly outstanding collection of exercises and I'd strongly advise you try as many of them as you have time for.