Praise be to Allah.
If the yellowish discharge comes straight after the menses then it is part of the menses, and it is not permissible at that time to have intercourse or to pray or fast. If the yellowish discharge comes after the end of the menses (tuhr), then it is not counted as anything.
As for the yellowish discharge that comes directly before the menses, if it is accompanied by the pains of menses (cramps) that happen to women, then it is menses; if it is not accompanied by pains, then it is not menses.
See the answer to question no. 37840.
The end of menses (tuhr) occurs when one of two signs appear: the emission of a white discharge, or when the place becomes dry, so that if a piece of cotton etc is inserted it comes out clean with no trace of blood or yellowish or brownish discharge.
It is not permissible for the husband to have intercourse with his wife during her menses, because Allaah says (interpretation of the meaning):
“They ask you concerning menstruation. Say: that is an Adha (a harmful thing for a husband to have a sexual intercourse with his wife while she is having her menses), therefore, keep away from women during menses and go not unto them till they are purified (from menses and have taken a bath). And when they have purified themselves, then go in unto them as Allaah has ordained for you (go in unto them in any manner as long as it is in their vagina). Truly, Allaah loves those who turn unto Him in repentance and loves those who purify themselves (by taking a bath and cleaning and washing thoroughly their private parts and bodies for their prayers)”
So it is not permissible to have intercourse with a menstruating woman until she becomes pure (her menses ends) and she has done ghusl.
There is a stern warning against having intercourse with a menstruating woman, as was narrated by al-Tirmidhi (135), Abu Dawood (3904) and Ibn Majaah (639) from Abu Hurayrah (may Allaah be pleased with him) from the Prophet (peace and blessings of Allaah be upon him) who said: “Whoever has intercourse with a menstruating woman, or with a woman in her back passage, or who goes to a fortuneteller and believes what he says, has disbelieved in that which was revealed to Muhammad.” Classed as saheeh by al-Albaani in Saheeh al-Tirmidhi.
The husband may enjoy his menstruating wife in ways other than intercourse. See question no. 36722.
The wife does not have the right to agree to this evil, rather she must refuse.
The husband must fear Allaah and beware of haraam forms of intimacy. In that which is halaal there is sufficient. In addition to being haraam, having intercourse during menses is harmful to both the man and the woman. See question no. 43028.
And Allaah knows best.