How does the law treat euthanasia for palliative patients? Is it ok to ask for it and how would the act be treated (as a murder or ?)
Ohr Someach clearly states:
Jewish law forbids euthanasia in all forms, and is considered an act of homicide. The life of a person is not "his" - rather, it belongs to the One Who granted that life. It may be therefore be reclaimed only by the true Owner of that life. Despite one's noble intentions, an act of mercy-killing is flagrant intervention into a domain that transcends this world.
One source in the Chumash for this prohibition may be found the Book of Genesis 9 (5): "But your blood of your lives will I require; ...from the hand of man, from the hand of a person's brother, will I require the life of man." The additional phrase "a person's brother" after having already stated "from the hand of man" is redundant. The author of the book HaKtav v'haKaballah explains that this verse refers to a prohibition against euthanasia. Although murder is the opposite of brotherly love, one might think that euthanasia is in fact a permitted expression of brotherly love. This verse imprints on our conscience that this particular form of "brotherly love" is nothing more than plain murder.
There are at least two classical cases in the gemara, and (unsurprisingly) they would lead to conflicting generalizations. The halakhah's position is nuanced.
The first case is the people of the city of Luz. This was a remarkable city where no one lied. It was where they made tekheiles dye. Sancheirev didn't touch the city when he conquered Israel at the end of the First Commonwealth, etc... But also, no one in Luz ever die. What did old people do? When life got too bad, they would leave the city. (Sotah 46a)
The other is the martyrdom of Rabbi Chanina ben Teradion. The Romans put him to death by fire, wrapped up in a sefer Torah. But in order to make the suffering last, to slow the burning, they placed wet cotton between himself and the parchment. His students begged Rabbi Chanina ben Teradion to open his mouth, breath in the smoke, and thereby hasten his death by suffocated. He refused, saying that it wasn't for him to end his own life. Despite all his suffering (AZ 18a)
One story implying euthanasia is okay, the other about someone refusing the way out.
Halakhah prohibits euthanasia, but... There are situations where not everyone would require heroic efforts are not mandatory to maintain life.
What this means in practice is that it's prohibited to "pull the plug" on a running machine that is keeping someone alive. However, if the machine is routinely disconnected for a few seconds, eg to change filters, to change cannula, etc..., many of the more noted decisors would say it is not mandatory -- and at times prohibited! -- to turn it back on.
To give more details.
I had a teenage cousin in this circumstance, and this was the ruling the previous Bostoner Rebbe zt"l gave her father. But it's consistent with published responsa.
Rav Moshe Feinstein (Igeros Moshe CM 2 ) and R SZ Auerbach (Minchat Shlomo 91:24) rules that a patient does not need to choose life extending treatment.
Furthermore, Rav Moshe Feinstein (Igeros Moshe YD 2, 174.3) altogether prohibits extending someone's suffering in such a circumstance.
In contrast, R' Eliezer Waldenberg (Tzitz Eliezer 15 40:4) ruled that the choice is not theirs, and the treatment must be given. (R Waldenberg was a member of the High Rabbinic Beis Din of Jerusalem, halachic decisor for Shaarei Tzedeq hospital.)