Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
Although wearing false hair or nails, etc. are not recommended, it has nothing to do with the validity of Prayer. Prayer is not nullified by these things as long as one has fulfilled all of the requirements of purification.
Answering your question, we would like to state the following:
The problem occurs if these items are worn before wudu and they prevent water from reaching body parts that should be washed/wiped during wudu. In such a case the wudu is incomplete.
Regarding fake hair, there is disagreement among scholars about the permissibility of wearing it in the first place. Its ruling involves such factors as the purpose of wearing it, the material it is made of (natural or artificial hair)… etc.
Like makeup and fake nails, wearing fake hair does not invalidate an existing wudu. But wearing it before wudu can lead to the same problem of preventing water from reaching the head.
There are differences among scholars whether it is OK to wipe part of the head plus the fake hair in wudu. As for ghusl, the fake hair needs to be removed and the whole head should be washed.
Finally, purification (taharah) is of three kinds:
1- Purification from physical impurities (najasah) like urine, stool, etc.
The body and cloth of a person intending to pray, as well as the place of prayer, must be clean from this type of impurities before starting Salah.
2- Purification from the state of major impurity (Janabah or al-hadath al-akbar). Some causes of the state of major impurity are sexual intercourse and ejaculation. A full-body bath (ghusl) is required to get purified of this state.
3- Purification from the state of minor impurity (al-hadath al-asghar). One gets in this state after doing one of the acts that invalidate wudu like relieving oneself. To get purified of this state, one needs to perform ablution or wudu.
📚 Read Also: How Should a Woman Wipe Her Head When Making Wudu?
In some cases, tayammum is allowed as a replacement for wudu or ghusl.
To conclude: Prayer is valid if a person fulfills the required conditions and integrals of prayer. Wearing a fake hair or nail does not invalidate it.
Allah Almighty knows best.