Salam,I'm sending this question again to be clear on what I'm asking.Here is the original question I send previously and made the last sentence to be clear:"Salam, I was praying with a female staff member. We both prayed 4 ra'kahs. My intention was to pray 4 as Fard and be done. The staff member and I finished for praying 4 ra'kahs together. However, she continued to pray another 4 ra'kahs for some reason. I was waiting for her to finish, because the room we were in was small. When she finished praying she allowed me to go on ahead, told me that she will be reading, and will be taking her time. Is what the staff member did is from the Qu'ran and the Sunnah? I know that a person can 2 Sunnah, then 4 Fard, and 2 Sunnah." Is my prayer valid, because she prayed 4 rak'ahs as Sunnah?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
The question is somewhat ambiguous. It is possible to perform four Rakʻahs as Sunnah (voluntary prayer) after performing the Fardh (obligatory prayer) in case of the Thuhr prayer. Umm Habeebah narrated that the Prophet said: “Whoever performs four Rakʻahs before Thuhr prayer and four after it, Allaah forbids his flesh from Hellfire.” [Ahmad and An-Nasaa’i in As-Sunan Al-Kubra]
Regarding the validity of your prayer because she performed four Rakʻahs as Sunnah after the Fardh, you should know that the validity of your prayer has nothing to do with hers as long as you performed the Fardh and finished it properly. In this case, your prayer is valid, whether she has performed two or four Rakʻahs as Sunnah or did not perform any after the Fardh.
Also, if you mean that you performed the Fardh behind your friend while she was performing a Sunnah prayer, your prayer is valid as well and there is no problem with that according to the opinion adopted on Islamweb.
Allaah Knows best.
You can search for fatwa through many choices