In the near future, the human population is overcrowded and food and water becomes scarce. Every preventative measure failed to address this issue and the world falls into a turmoil and panic is everywhere. It was suggested that humanity is one of the creatures that have sex for pleasure and decided that we should nerf the brain reward system. Then many governments gave in to corruption and pressure from a series of nationwide protests. They launched a campaign to force everyone to take a pill (nanites) that can kill pleasure while having intercourse. Such extreme measures are becoming popular with many big companies due to the increasing demands. Ok I think you get the idea but I suspect being a human goes beyond biology but I cannot think of what grave consequences if the plan goes well.
The drive to have a child is one of the strongest ones out there. Not everyone wants a child of course, but a great many people do. We humans may get children via intercourse but that is not why we want to have them.
Lots of couples right now have sex for procreation even though they're not getting much out of it. Some people have sex with people they're not really into or in a relationship for the purpose of getting pregnant. Other couples and singles use artificial insemination to have kids. It's easy to do this at home and many do.
Also, sexual pleasure is not the only thing people get out of sex. Emotional intimacy is a huge one and a lot of couples who are meh about the sexual pleasure still want to have sex. There are many other reasons people have sex as well.
This question makes a lot of assumptions that have no basis in fact. Call it a frame challenge. Your beliefs about "reward" don't hold water.
If your scenario came to pass, people would likely have less sex than they do now. Some people would have less in general and a larger percentage of people than now would have none.
As a general rule, this would lead to fewer pregnancies, though it's not as straightforward as you might think. It also means more (but not all) pregnancies would be planned, so fewer abortions and adoptions. But don't assume it's linear. If a couple (who doesn't use birth control and doesn't plan out cycle timing) goes from, say, having sex 20 times a month to 10, they aren't going to have half the number of pregnancies. It probably won't change much, if at all.
Note that I'm not addressing changes in contraception use. A society with the population pressures you mention will be high users of birth control. Much higher than we have now, and we use birth control an awful lot in most countries. Couples who have sex for reasons other than sexual pleasure may use birth control more (since any side effects of lessening pleasure don't matter) or they may use it less (under a mistaken belief that pregnancy rates are correlated with amount of sex).
The rise in population would slow and maybe even reverse. Eventually, the population will stabilize because people will choose to have children based on things that have nothing to do with how often they have sex.
The simple answer is no. The human species will not go extinct.
If governments can legislate and enforce the world's populations into taking a pill to abolish sexual pleasure, it will be an even simpler step for those governments to regulate reproduction. This have additional benefits. It will make economic planning and resource management so much easier. It will alleviate and ameliorate demographic pressures on forward social, political and economic development.
In an overpopulated world, well regulated reproduction will make the process of reducing the global population to long-term sustainable levels a much easier task.
Families also want to reproduce and have children to carry on the family name, inherit assets and property, have someone to look after you in your old age, and so on. Sexual pleasure is not the sole driver of reproduction.
Large-scale family planning can be managed to allow people to manage their careers and have families of their own without disrupting those careers.
Sex by itself is not the only means to ensure reproduction. Artificial insemination and in vitro fertilization technologies have been improving. Assuming this will improve in future, conception will become as easy as a visit to your GP.
Many of the world's religions will embrace the change. The majority of people won't be running off to indulge themselves in illicit sexual liaisons. Sex before marriage, adultery, pornography and prostitution will be a thing of the past. People will only think pure thoughts. Productivity will rise.
A sexual pleasure free world will be embraced as a better, purer world. Even in the absence of sex, the species will continue to reproduce the social, familial, economic, political and demographic pressures are too great to allow extinction to happen. It will make the reduction of excess numbers of people easier to manage and it will alleviate the problems of an overpopulated planet.
Humans would still want children and have the drive to have sex for it. But it would severely hamper the amount of children that are born.
Accidental pregnancies wouldnt happen anymore
People would have more trouble arranging the times to try to het pregnant, as spontaneous wouldnt happen.
most of the sexual activity is conscious. While it is completely possible for people with paralisis, full spinal leasions or even in a coma to get aroused enough to ejaculate, it is a lot harder (heh) to get the job done properly. In fact, not having arousal because the lack of pleasure could make it even harder when you are still "in control" over your genitals as the focus shifts away from having sex and towards a chore, killing the mood for sex quickly and reducing the arousal that comes for paralised/comatose people.
Lack of pleasure kills off a lot of the advantages that sex normally gives, like social bonding to the partner.
All in all, this could mean that the average children born to people will drop so drastically, that humanity wont be able to sustain itself. Imagine each couple only getting one child because getting one has become so much of a hassle, you'll halve mankind each generation...
Sexual ahedonia is basically what you'll be giving everyone, which is a problem where you are unable to feel pleasure of the orgasms even when you know you are having one. A part of the things I said can be found here: https://www.issm.info/sexual-health-qa/what-is-orgasmic-anhedonia-pleasure-dissociative-orgasmic-dysfunction/
Looking at the real world for an explicit example: Lesbian couples get pregnant and have children. Gay couples adopt or arrange a surrogate mother. Other couples or individuals adopt or foster children - there are "serial foster parent" out there who have 'had' dozens of children, even if none were born to them.
These are clearly not a result of "sex for pleasure" (whereas that could be argued for even carefully planned pregnancy in a heterosexual couple), and can be via artificial insemination or IVF. Evidentially, a desire for children exists independent of a desire for sex.
So, yes, your population may decrease with the absence of "whoopsie!" babies - but it won't die out from your magic pill.
Killing pleasure in a specific context is not something that is readily accomplished. I couldn't even begin to theorize about how it would work. From my own experience, I don't believe there is any physiological difference between pleasure induced by sex or. Any other means.
However, killing pleasure in general is trivially accomplished mechanically. The hemispheres of the brain float independently inside the skull, joined by the corpus callosum. A sharp blow to the occipital bone at the correct angle will often cause the two hemispheres to shift in opposite directions, creating a scissors like action on the front of the corpus callosum. For a more definite and controlled approach, a scratch in the right spot with a simple probe (crochet hook) would accomplish the same thing.
Normal emotional processing, including pleasure from sex, requires cooperative processing on both hemispheres of the brain. Even a small scar on the front surface of the corpus callosum can interfere with that processing, inducing alexythymia (essentially absence of emotions)
While this ends the enjoyment of sex, it does not end the drive. The stereotypical football player or boxer who's taken one to many hits to the head may become possessive (territorial) while blaming their partner for the lack of enjoyment. Think of the number of star football players who end up in a spousal abuse scandal. Alternatively, they may lose all interest in sex, as a messy complicated waste of time and energy.
Emotions are a huge part of who we are. Other impacts of alexythymia include reduced ability to form new memories, inability to read or produce social cues, and inability to prioritize.
So, to answer your question, eliminating the pleasure from sex would probably not end the species, but it would have serious side effects for the society attemptimg such a thing. I would not expect such a society to last past the first generation.
answer to the extinction question is:
No it is unlikely to go extinct with just a lack of pleasure
There is likely to be a decline in population and that will ring it's own problems/challenges
Problems with Population Decline
Gender balance would be difficult as we can't currently choose to have a male or female child when reproducing. this would lead to further gender inequality since I'm assuming countries will still have border laws making the balance per country different as well
Men wouldn't be as nice to women since they would not be thinking with their dicks half the time
There would be fewer customers for businesses while the population stabilizes, causing many businesses, perhaps entire business sectors, to go out of business