Should I do all the exercises in a textbook? The problem sets that you usually get in a university course is a small fraction of the exercises in your textbook. Which raises a question: do you need to solve all the exercises from your textbook? Maybe the author just presents a lot of them so that your professor can choose those that fit his course.
I'm looking for a reason not to do all the exercises, or even only do the course's problem sets (a small fraction). For example, Pugh's "Analysis" claims to have more than 500 exercises—that's way to much; I think the bulk of them is not essential. The main idea of studying mathematics is to learn new mathematical concepts, and not get bogged down in routine computations.
What is the reason of the problem sets? Maybe just to check that you understand the concepts well. But maybe the problem sets are so small because they are meant to be checked by some person, otherwise they would be bigger.
EDIT:
Especially it relates to the courses that you need as a prerequisite for the other much more important course. For instance, I need Linear Algebra as a prerequisite for Analysis. When I get to Analysis, I will do all the exercises. But I don't want to spend a lot of time on Linear Algebra—I understand the concepts, understand the proofs, and that's it.
 A: I will be contrarian and say "Yes...do them all".  
Of course someone could arbitrarily double the problems in a text.  Or have a problem that is unsolvable. Or say what if I did 399 of 400 problems--is all lost versus doing 400 of 400?  But these are nitpicking exceptions--you want to know a practical guide in spirit:  (a) do all the problems or (b) do the teacher issued and much smaller subsection of problems. 
Jaime Escalante (teacher in Stand and Deliver who got 70+ AP BC passing students from a ghetto LA school in the 80s!) thought problem volume was key factor.  He even assigned extra volume above the text.  "Miles build champions".  
Note, that an obvious disadvantage of doing more problems is time, but it is also true that with problem volume, your facility and speed increases.  This is a well known training effect.  In many intellectual and physical trainings.  If the problems become repetitive, than it is drill.  But drill goes fastr.  And drill has a benefit--we are not computers to get an algorithm once and know it forever. There is "muscle memory" in piano.
It also becomes less likely that you fool yourself into thinking you know what you don't, if you do them all rather than saying "got it".
In addition, you are less likely to omit a particular trick or the like.  Consider that authors may differ in how much the cover different things.  One may only have one problem with Chebychev polynomials or Bessel Equation.  A competitor may have several or a whole small section of the written text plus many problems.  If you do all problems with the ODE text that only has one of the CP or BE problems, you at least cover it once.  If you skip around, may miss it.  And good luck deducting it at the time, first time, under exam pressure, with zero pre-exposure!
[You may even want to consider if your book lacks problems of a certain type.  It may lack some easier problems to get familiarity.  Professors and advanced classes love more difficult or project-ish problems, especially when having graded, non-drill type homework in college. But you actually get a pedagogical benefit from plug and chug drill that may be lacking if the problems are all to intricate.  Also, easy problems ease you in and make the harder ones not as hard.  The converse can also be true that you lack enough hard problems.  Or you may be lacking problems that are word problems or that are not word problems or that cover a specific area (e.g. calc book might skimp on related rates).  But again this is a caveat.  In general, especially for books that sell a lot, they will have ample problems and you will get what you need by working them all.]
Also note that if you are weak in algebra (or not even weak, but just not clockwork-like accurate) that doing lots of calc problems gives practice in the algebra as well as the differentiation and integration techniques your practice.  Same is true into the higher and higher level subjects.
A few practical stories of people who worked all the problems and got the benefit:


*

*Freeman Dyson worked all the ODE problems in an ODE book over winter break, teaching himself the subject.  He enjoyed it and benefited from it. (Is a video on YT of him talking about it.)

*Dick Feynman felt he needed to learn classical E&M better when developing QED.  He worked every problem in a conventional E&M text.  He also worked every problem in calc texts and in quantum theory.  

*Lars Onsanger did all the problems in Whitacker and Watson.

*I worked every problem in 1980s AP calculus and chemistry texts.  And crushed the APs and college entrance exams.  Doing better than students with higher IQs.  [And I am nothing like the gods in 1-3, but would make a strong case that both for mortals and gods, there is a benefit from doing all the problems.]  It really was not that bad in time...just went fast and intense every night.  It was also a beautiful feeling, that feeling of mastery.  Very different from courses with a B or C or even a low A.  That A+ feeling where you have made it your b#$*&.  Courses stuck with me for decades and were useful even after leaving business world and going back to academia later in life.  Courses where I did not not do all the problems didn't give that feeling at the time or stick with me for years.
A: (I've put my remarks on book exercises in a comment above.) Something I tell students is that the point of practicing the problems is to find out what you don't know how to do.  (Better there than sitting at an exam -- or needing something in your own work later on...)  Your life-work is not solving all the problems in a book, but a decently-prepared text is intended to guide you in what is important to understand in your work (theoretical, applied, whatever) with the ideas discussed.  So it will be important to you to be thorough, but you will never have time to spend on everything in one book (unless -- maybe -- it's fairly brief).
I don't want to repeat too much of what everyone else has already said.  You won't master everything during the time of a single course anyway.  The important thing in mastery is steady work, coming back to the ideas (and problems) repeatedly over time.  Really great books are ones you find you can still learn things from later, as your own experience grows.  This is why some books are worth keeping for a lifetime. 
A: Helpful Tip: I like to use a random number generator, from $1$ to the number of exercises in the section, to get $5$ or $10$ questions from the section exercises, then pretend I'm taking a test. You can do this multiple times, of course with new sets of numbers.  Most of the time this will give you a broad selection of questions and will replicate the randomness of tests.
A: 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!
A: 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. 
A: 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. 
A: You should do as many exercises as you need to, and you should have sufficient self-awareness in relation to the subject to distinguish between "need" and "want".
Exercises are not an end in themselves.  They are a means of learning the subject.  If you understand a topic after solving a small number of exercises you can certainly skip the rest - perhaps come back to them later for revision.  If you see that you can do an exercise without writing it down, then don't write it down.  (But a word of warning: it's easy to fool yourself on this point.  Maybe you should write it just in case.)  On the other hand, if you finish all the exercises and still don't feel that you understand the topic, seek out some more.  In some cases you will be able to repeat the exercises you have already done, changing the numbers to make them slightly different; in other cases you will need to ask your instructor for suggestions.  If you finish a ridiculously large number of problems and still don't fully understand the topic, it may well be that your difficulty is not with the topic itself but with something in the background.  In this case you should certainly seek advice from your instructor.
One final comment: once you have mastered a topic, you will still want to do the occasional exercise so as to keep yourself "in form".  Think of the world's best athletes - once they're on top, do they  stop training?  Of course not - they keep it up so that they stay on top.  Mathematics is not really very different from that.
Good luck!
A: I'll start with an example then give some detailed advice:
I recently had an exam in multivariable calculus. There were about 600 problems in our text, Thomas's Calculus. With the intention of doing them all, I spent 60 hours on them and only finished half before the exam. After all that, the exam felt trivial, which was great, but I also felt I could have had a similar result studying 15 hours and then another textbook, reviewing, thinking about the big picture, etc.
Disclaimers:


*

*Level: I'm still taking lower div courses (Multivar Calc, Diff Eq), so this advice is geared toward that level.

*Texts full of good problems: I hear that some texts have amazing problems. In those cases, consider doing all of them, especially if there aren't so many. 

*Important skills: Certain skills are useful and so doing all or most of the problems in a section may be worthwhile. For example, fluency with integration can be really helpful in multivariable calculus, differential equations, and physics. 


Since each text and each topic is different, a flexible approach is important. The method below is about jumping around in each section and cycling between sections. It will let you do all the problems or just a fraction by exploring a bit of the material and then adjusting the numbers according to your time, interest, comfort level, and needs.
An approach to studying:


*

*Problems first: Do not read through the chapter initially. Wait until you've spent half an hour or more (depending on difficulty) attempting some problems.

*RNG: Use an RNG to randomly choose which problems you do. Mark which problems you've done or make a list or whatever works for you. I use a Google spreadsheet where I list the problems then use =INDEX(SORT(A$3:A), RANDBETWEEN(1,COUNTA(SORT(A$3:A)))) to randomly pluck one. I copy that number, search, delete, then work the problem.

*Difficulties: Before reading the chapter, when you encounter a problem you're not sure how to do, make a mental or physical note of what was hard, then try another problem. The idea is to give your brain context for when you're reading the chapter, improving focus.

*Read: Now that you have some context, read.

*Actually do problems: Now, do 5–10 problems (a few hours worth) picked randomly.

*Move on: At this point, move onto the next section and repeat the process. After you've done 5–10 problems in that next section, do 3–6 problems in the previous one(s). In this way, you'll constantly be cycling backwards and forwards in the text, which will aid you in seeing how concepts are connected as well as naturally acting as a review process.

*Judging problems: Every time you're about to go back to a section to do problems, first look at a couple you haven't done. If a problem stands out as potentially interesting, do that and count it toward your 3–6. Since you already have some experience with the section, you may have a better sense of what will be interesting.

*Thinking through problems: Difficult problems may benefit from a look first. Think about what you'll need to solve it. If the solution is obvious, consider skipping the problem to save time. This can be dangerous though as people are notoriously prone to assuming competence. Furthermore, sometimes unexpected edge cases are hidden in seemingly innocent problems. Be responsible. Also, even if you can see the path to the solution, practicing something within your comfort zone can still help in terms of making less silly errors, organizing your problem solving approach, and drilling the concepts into you, giving you more flexibility with them so you can recognize the concepts in other contexts where they might not be as apparent.


Note: I've heard some advanced texts don't have many or any problems. I don't have experience with that.
How to read when you need guidance:


*

*Participate: Theorems/proofs/examples should be read one line at a time as you write out what is happening and what is about to happen.

*Or not: If you're pressed for time then just read through to get the gist. Do what you have to.


Other ideas:


*

*Good problems: If you encounter a good problem, write down its number in a list or spreadsheet. Schedule time daily to cycle through this list. This will keep the most interesting ideas fresh in your memory forever. Put interesting proofs/theorems/whatever in this list. Caution: Avoid facts and memorization unless you really need to; instead you ought to focus on problems, derivations, and use cases.

*Mistakes: As you do problems, try to notice your common mistakes or make a list and include a note about how to fix the issue. Copying errors and dropped negatives were common for me. Now, I've gotten in the habit of double checking when I copy from above. I underline terms as I bring them down. My negatives are all long and apparent.

*Exams and self-checks: For students who are taking exams, get in the habit of checking your work. As you work the problem, reread the question to ensure you're answering the right question and that you're using the right units, etc. Perhaps, begin each question by writing symbolically the givens and a numbered list of what variables/concepts you need to solve for; it's common for students to forget to completely answer every part of a problem.
If you can use a nicer calculator (TI-83 etc), try to devise methods to check your work. Almost every problem I do now, I try to find a quick way to check my answer or aspects of it using the calculator. You can write programs as well that can automate some of the checking process. If you want details, ask in the comments.
A: In my view solving all question of each exercise do not improve mathematics skill. Beacause many question are of same nature and easy as well the best way to do maths is do question levelwise. Firstly very easy which can be done orally. Than easy, difficult, and very difficult. The problem is that maximum student wasting their time in doing easy questions. Students do not concentrate on difficult question. So they are not able to solve application based questions.
