Can You Pray with Yellow Discharge before Period?
Question

I am not married and my period comes regularly every month. But my problem is that it starts off yellow, tinged with beige and brown, and sometimes goes on for three or four days with pain in the lower abdomen, intense agitation and bad mood. Then it becomes black for one or two days at the most, then red blood comes for between five and seven days, then it goes back to a brown colour, then yellow, then after one or two days of the yellow discharge, sometimes there is a white discharge, the sign of purity (end of the period), or sometimes the yellow discharge continues until the next period, i.e., it lasts for a month.
My question is: when should I pray and when should I stop praying? When should I fast and when should I not fast?
Praise be to Allah.Ruling on yellow discharges before period
The yellowish or brownish discharge that precedes the blood is not regarded as the menses; the same applies to that which comes after seeing the white discharge (that signals the end of the period), because Umm Salamah (may Allah be pleased with her) said: “We used not to regard the yellowish brownish discharge after the white discharge (that signals the end of the period) as being of any significance.” (Narrated by Abu Dawud, 307; classed as authentic by Al-Albani in Irwa’ Al-Ghalil, 199) 
Ruling on yellow discharges after the bleeding and before the white discharge
With regard to yellowish and brownish discharge that comes after the bleeding and before the white discharge (that signals the end of the period), this is regarded as menses, because of the report narrated by Malik in Al-Muwatta’, 130, from Umm Salamah (may Allah be pleased with her), according to which she said: The women used to send to `Aishah, the Mother of the Believers, small vessels containing the pieces of cotton on which there were yellowish traces from the menstrual blood, and they would ask her about praying, and she would say to them: Do not be hasty, wait until you see the white discharge, referring to that which signals the end of the period. 
This was also narrated by Al-Bukhari in a mu`allaq report (Kitab Al-Hayd, Bab Iqbal Al-MahId wa Idbarihi; classed as authentic by Al-Albani in Irwa’ Al-Ghalil, 198)
Based on that, the yellowish or brownish discharge that lasts for three or four days before the bleeding starts is not regarded as menses, and you should not stop praying or fasting at that time. 
The black blood and the red blood that comes after it, and the yellowish discharge, are menses, until you see the white discharge or complete dryness. 
If you see the white discharge or complete dryness, then any discharge after that, yellowish or brownish, is not regarded as menses. 
Ruling on the red blood that continues longer than 15 days
If the red blood continues, or the yellowish or brownish discharge that come after it, before the white discharge or complete dryness appear – if that goes on for longer than fifteen days, then you are experiencing Istihadah (irregular, non-menstrual bleeding), according to the majority of scholars.
Some scholars say that Istihadah cannot be proven unless that continues for the entire month or for the entire month apart from two or three days. This is the view favoured by Shaykh Al-Islam Ibn Taymiyah (may Allah have mercy on him) and those who followed him and those who do not think there is any maximum length for the menses, and their view is closer to the apparent meaning of the evidence. 
If it becomes clear that you are experiencing Istihadah , then in the following months you should act in accordance with your cycle as it was in the past. So you should stop praying and so on for the duration of bleeding, until the appearance of the white discharge (signalling the end of the period) that you mentioned in your question, then you should do Ghusl. For example, if your period, before experiencing Istihadah, used to last for ten days, then you should do Ghusl after the tenth day, and do Wudu at the time of each prayer. 
A woman who did not have a regular cycle before experiencing Istihadah should base her actions on differentiating between different kinds of bleeding. This has been explained in the answer to question no. 68818  
Our advice to you is to consult a specialist doctor for treatment of these ongoing discharges. 
And Allah knows best.