How to not feel bad for doing math? I have a MsC and want to take a PhD in algebraic topology. Probably very few people in the world will have any interest of my thesis.  They will pay me for doing my hobby. Its the only job I can think of which doesnt contribute to bettering the world somehow. I feel like I should get a real job like doctor or garbageman. I  get bad conscience. How can I feel better for pursuing my dream?
 A: Perhaps you need to read  G. H. Hardy's A Mathematician's Apology. 

One of the main themes of the book is the beauty that mathematics
  possesses, which Hardy compares to painting and poetry. For Hardy, the
  most beautiful mathematics was that which had no practical
  applications in the outside world (pure mathematics) and, in
  particular, his own special field of number theory. Hardy contends
  that if useful knowledge is defined as knowledge which is likely to
  contribute to the material comfort of mankind in the near future (if
  not right now), so that mere intellectual satisfaction is irrelevant,
  then the great bulk of higher mathematics is useless. 
  He justifies the pursuit of pure mathematics with the argument that
  its very "uselessness" on the whole meant that it could not be misused
  to cause harm.
  On the other hand, Hardy denigrates much of the applied mathematics as
  either being "trivial", "ugly", or "dull", and contrasts it with "real
  mathematics", which is how he ranks the higher, pure mathematics.

[bolding mine]
Somewhat ironically, some topics that were in Hardy's day the domain of pure mathematics now have very practical importance, eg, algorithms used in public key cryptography rely on things like the difficulty of factorization of large numbers, properties of discrete logarithms, elliptic curve theory, etc. 
A: Simple - you contribute to humankind according to your ability to do your job.  Your ability to do your job is fundamentally affected by your enthusiasm for your job.  It stands to reason that the people should be taking jobs doing things they want to do anyway, regardless of pay, perks, etc.
If you are making great contributions to algebraic topology, then that is what you should be doing.  The small number of people being interested in your field means that opportunities might be limited.  But if this is what you are determined to do, then you should be able to contribute.  (Of course, always have a Plan B.)
If you pursue the medical or the sanitation arts despite showing no interest in either, you will not be able to contribute all of which you are capable.  That robs all of us of your potential.  Worse, you might get depressed over your inability to pursue your dream.  Depression is expensive and does you no good.  Better that you strive to be an algebraic topologist, where your contributions will be great and your happiness unbounded.
Never feel guilty about doing what you want to do for a living.  It is a gift from a successful society.
A: If you are going to take a "real" job as you say, without the will for it, you will feel even worse. This feeling may make you under perform and actually you can end up even contributing less to bettering the world as you expected, so your choice should always be what you really like. If you have an easy access to this PhD position I really recommend you going for it. Moreover, as hardmath pointed out you will be very useful by sharing your knowledge with students.
A: It is worth noting that in the dim and distant past, graph theory was considered recreational math with no practical application to real life; however, now graph theory is essential to computer science, modeling the brain, and all sorts of other practical fields. So right now algebraic topology may seem abstract and nonapplicable, but in 100 years, your research could be essential to a new development in a field which has appeared, which no one foresaw.
