Good deeds done before saying Shahaadah are not valid
Question

 
I will post my question again, I have been reading the Quran the past 2 years and am almost through it. In my reading I have become more and more convinced about the truth of the Quran and I have this year for the first time started to fast with my friends.
My period started on the 2nd fast and I was given conflicting advice by 2 lady friends. One said continue with the fast the other said to stop. I then asked a male friend and he advised me to stop.
Yesterday I read an article on Ramadan and it said that if you have not said the Kalimah your fast is not accepted. I am not going to repeat my whole story here, but I have sent the Kalimah to a friend as an SMS and they all know I do believe.
My situation does not permit me to openly live the life of a Muslim and I have begged God to help me. I believe He understands my situation. May I continue to fast or should I stop?.
Praise be to Allah.We ask Allah to open your heart to Islam and to help you to adhere to the rituals of Islam, both outwardly and inwardly. Undoubtedly your keenness to read Quran and to fast indicate that you possess a great deal of goodness and love for righteous deeds. We ask Allah to give you strength and help you. But you have to realize that this great religion comes from Allah, the All-Wise and All-Knowing. Whatever is enjoined by Allah and by His Messenger is Islam, and we can only know Islam through the Messenger (peace and blessings of Allah be upon him), who is the one who conveyed it from Allah. 
The Messenger (peace and blessings of Allah be upon him) has told us in more than one hadeeth that Allah does not accept any righteous deeds until after the person has uttered the Shahaadatayn. Indeed he told his companions not to tell anyone to do any of the rituals of Islam until they had pronounced the Shahaadatayn. In Saheeh al-Bukhaari (7372) and Saheeh Muslim (19) it was narrated that when the Prophet (peace and blessings of Allah be upon him) sent Mu’aadh to Yemen to call the People of the Book to Islam, he said to him: “You are going to some people from among the People of the Book. Call them to bear witness that there is no god but Allah and that I am the Messenger of Allah. If they accept that, then tell them that Allah has enjoined on them five prayers each day and night. If they accept that, then tell them that Allah has enjoined upon them charity [zakaah] to be taken from their rich and given to their poor…” According to a report in Saheeh Muslim he said: “Let the first thing to which you call them be…” 
Hence it should be clear to you – may Allah help you to do good – that uttering the Shahaadatayn is the first thing that the Muslim must do if he wants to become Muslim. It is not essential for you to announce that to your family if you are not able to do that and you fear for yourself and your religion. Rather it is sufficient for you to say these words to yourself, until the time comes when you can announce it to others, when you must do so.  
With regard to fasting, the Prophet (peace and blessings of Allah be upon him) told menstruating women to refrain from prayer and fasting during menses (the monthly period). When the period ends, a woman has to make up the fasts of the days that she has missed. With regard to prayer, she does not have to make up the prayers. The evidence for that is as follows. 
A woman asked ‘Aa’ishah (may Allah be pleased with her), why it is that a woman who menstruates has to make up the fasts but not the prayers? She said: “Are you a Haroori?” She said, “No, I am just asking.” ‘Aa’ishah (may Allah be pleased with her) said: “That (menstruation) used to happen to us at the time of the Prophet (peace and blessings of Allah be upon him), and we were commanded to make up the fasts but we were not commanded to make up the prayers.” Narrated by al-Bukhaari, 321; Muslim, 335. 
This woman wondered why, when her period came and she did not fast or pray, Allah commanded women to make up the fasts but not the prayers. ‘Aa’ishah (may Allah be pleased with her) replied by telling her that this was the command of Allah and His Messenger (peace and blessings of Allah be upon him), and we must accept the command of Allah and His Messenger without raising objections based on our weak mental capacity which can only encompass a little of the wisdom of Allah the Most Wise, All-Knowing, which is what Allah has taught us. 
The ruling which we have mentioned is agreed upon by all the Muslim scholars. Imam Ibn ‘Abd al-Barr (may Allah have mercy on him) said in his book al-Tamheed (16/67): “A woman who is menstruating should not pray, and there is consensus on this point.” And he also said  (22/107): “… There is consensus that a menstruating woman should not pray during the days of her period, and she should make up the missed fasts but not the prayers, and there is no difference of opinion on any of that.” 
With regard to the rest of the rituals of Islam, you have to do whatever you can. Whatever you are unable to do because of fear for yourself or your religion, you are not obliged to do, as the scholars have stated, because in that case you come under the ruling of one who has no choice, and Allah made allowances for the one who is forced to disbelieve (outwardly), so long as his heart remains open to faith and still hates kufr (disbelief). Allah says (interpretation of the meaning): 
“Whoever disbelieved in Allah after his belief, except him who is forced thereto and whose heart is at rest with Faith; but such as open their breasts to disbelief, on them is wrath from Allah, and theirs will be a great torment”
[al-Nahl 16:106]
See al-Mawsoo’ah al-Fiqhiyyah, 13/196 
But you have to practise as much as you can of the rituals of Islam, then try to reach a place where you will be able to practise as much as you can of the rituals of Islam. This action is what the scholars of Islam call hijrah (migration for the sake of Allah), and it is obligatory for every Muslim man and woman if they are unable to establish the rituals of Islam in their own country and they are able to migrate. The evidence for that is the verse in which Allah says (interpretation of the meaning): 
“Verily, as for those whom the angels take (in death) while they are wronging themselves (as they stayed among the disbelievers even though emigration was obligatory for them), they (angels) say (to them): “In what (condition) were you?” They reply: “We were weak and oppressed on the earth.” They (angels) say: “Was not the earth of Allah spacious enough for you to emigrate therein?” Such men will find their abode in Hell — what an evil destination!
Except the weak ones among men, women and children who cannot devise a plan, nor are they able to direct their way”
[al-Nisa’ 4:97-98]
This indicates that only those who are weak are excused the obligation of migrating. 
It says in Mughni al-Muhtaaj (6/54): 
If a person is not able to practise his religion openly or he fears persecution, then it is obligatory for him to migrate, whether man or woman, even if she does not have a mahram (if they are able to migrate), because Allah says (interpretation of the meaning): “Verily, as for those whom the angels take (in death) while they are wronging themselves…” And because of the report narrated by Abu Dawood and others (according to which the Prophet (peace and blessings of Allah be upon him) said): “I disavow every Muslim who stays among the mushrikeen (polytheists, those who associate others with Allah).” A saheeh hadeeth  - al-Irwa’, 5/30. 
Ibn Rushd said: It is obligatory, according to the Quran, Sunnah and consensus of the Muslims for the one who becomes Muslim in a kaafir country to migrate therefrom and move to a Muslim country; he should not live or settle among the mushrikeen. That applies if he is unable to practise his religion, or he is forced to adhere to the rulings of kufr. 
From al-Mawsoo’ah al-Fiqhiyyah, 4/264 
Even though migration means leaving one’s family and homeland, Allah will fill the person’s heart with happiness which will make him keen to migrate. 
Thus it will become clear to you that so long as you are unable to practise the rituals of Islam, then Allah by His mercy will excuse you, and whatever you are able to do, then you are obliged to do it, even if you do it in secret. If you have to put up with some difficulties that you are able to bear in order to do that, then Allah will reward greatly the one who patiently bears hardship for His sake and for the sake of His religion. The Book of Allah is filled with stories that speak of that. Even though uttering the Shahaadatayn is so important, Allah has made that very easy. So we advise you to utter these words even if you only say them to yourself, because the soundness of your Islam depends on that, as I am sure you understand, until Allah makes it easy for you to announce it publicly, by His leave. May Allah help you to do that which is good.