Praise be to Allah.
Using needles is an ancient Chinese way of reducing pain and treating a number of various diseases by inserting needles into various parts of the body.
The specialist in this field, who is called the acupuncturist, inserts a sharp needle into any one of hundreds of specific points on the body. Insertion of the needle causes a sharp prick, but this quickly dissipates, to be followed by a prickling sensation or feelings of dizziness or drowsiness, or by pain when the needle is left in place.
Acupuncture is used to reduce pain and to treat various cases which include arthritis, asthma, migraine, abscesses and eye diseases, in addition to some forms of mental illness. The Chinese still use this method and since the end of the 1950s this traditional method has been used to reduce pain in major surgery, where the patient remains awake but feels a little discomfort or does not feel any pain at all.
See: al-Mawsoo‘ah al-‘Arabiyyah al-‘Ilmiyyah (al-Wakhz bi’l-Ibar).
Abu’l-Waleed ibn Rushd said:
They are unanimously agreed that at the time of fasting, the fasting person must abstain from food and drink, and intercourse, because Allah says (interpretation of the meaning):
“So now have sexual relations with them and seek that which Allaah has ordained for you (offspring), and eat and drink until the white thread (light) of dawn appears to you distinct from the black thread (darkness of night)”
And they differed concerning some issues. Some they kept quiet about and some they spoke about. As for those that they kept quiet about, one of them has to do with what reaches the inside of the body (al-jawf) but is not nourishment and what reaches the inside of the body by a route other than that by which food and drink reach it, such as injections.
The reason for their differences is based on the way they looked at that which nourishes and that which does not nourish, because the texts speak of that which nourishes. So those who thought of fasting as a rational concept did not regard that which nourishes as being the same as that which does not nourish. Those who thought of fasting as an act of worship and something that is not subject to any rational discussion said that what is meant by fasting is simply refraining from whatever may reach the inside of the body, whether it is nourishing or not nourishing.
Injections which are meant as medical treatment and not as food or nourishment do not break the fast of the fasting person, whether they are intravenous or intramuscular. Injections which are meant to provide nourishment do break the fast, as is the view of the majority of modern scholars.
This has been discussed previously in the answer to question no. 65632. See also Muftiraat al-Siyaam al-Mu‘aasirah by Dr. Ahmad al-Khaleel, 65-68
The needles used in acupuncture do not come under the same heading as injections meant to provide nourishment and they do not come under the heading of food or drink; rather no kind of solution or liquid can be introduced to the body through them, as is the case with regular medicinal injections. Rather they are a kind of pricking that is administered to specific places on the body with no intention of using them to introduce any kind of liquid into the body, as mentioned above.
Based on that, they do not affect the fast and there is nothing wrong with using them for medicinal treatments, if it is proven that they are of benefit to the patient.
And Allah knows best.