Your reasons for continuing are optimistic and perhaps privileged. For a large amount of people, especially for minorities and other groups in the past, contribution to the long-term well-being of humanity was not the goal. Some people had to watch as their children or parents were taken from them by war or sometimes trade and slavery. Perhaps those people sought revenge and reunion. Others were born into extreme poverty and prejudice. Perhaps they seek equality. Others were born into abundant wealth and perhaps they seek to amass more wealth and take advantage of a money-driven world. Yet other were born into internment camps and reservations. Maybe they continue out of ancestral pride or out of a sense of justice and reality. Because of nature of humans (i.e., greediness and hatred), in my opinion, the long-term well-being of humanity is a feeble goal meant for Engineers and Scientists for the most part.
At the same time, as Stephen Fry points out here, some people continue because others won't allow them to quit. Or, in a lot of situations, they can't quit without throwing the lives of their families and friends into a gambit.
Personally, I'm more of an Absurdist or Nihlist, and I don't really see much of a point to life. I continue because I'm seeking some kind of meaningful death. In that journey, I've picked up many people as acquaintances, lovers, family, etc, and if I can at least make some of them happier or better off, then maybe it was worth it.