I am studying in a non-Muslim country. I have female teachers and colleagues. Sometimes it is necessary to discuss something with a female teacher or colleague and it happens that we have a kind of fun during the discussion. Other times, also, they shake hands with me. I am afraid that my fasting is worthless and that I will get nothing but hunger and thirst. It should be taken into consideration that most of those around me, including sellers, house cleaners, etc are females, what is the ruling on my fasting?
All perfect praise be to Allah, The Lord of the Worlds. I testify that none is worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
The Prophet, sallallaahu ‘alayhi wa sallam, regarded the fasting of some people worthless. In this regard, it was narrated that he, sallallaahu ‘alayhi wa sallam, said: “Perhaps there is someone whose share of fast is nothing but hunger and thirst.” [Ahmad and Al-Haakim]
This is because attaining piety is the main objective of fasting. Allah Almighty says (what means): {O you who have believed, decreed upon you is fasting as it was decreed upon those before you that you may become righteous.} [Quran 2: 183]
When one fails to achieve the objective of fasting, which is attaining piety, nothing remains for him but hunger and thirst. So, beware of being one of those who fail to attain piety by doing what displeases Allah.
This is in terms of reward and achieving the objective for which fasting has been prescribed. As for the validity of fasting, i.e. absolving you of liability, your fasting is valid even though it is blemished by the misdeeds which you have mentioned, according to the preponderant opinion. However, if you experience a discharge of semen as a result of mixing with such women, your fasting is invalid and you are required to make up for the days in which your fast was invalidated and also to repent to Allah. If you are allowed to live in a non-Muslim country due to a necessity or because of the Muslims' need to your profession, then you should be wary of temptation and be very observant of your religious teachings. You should not go beyond need during the discussions with your female teachers and others and lower your gaze as much as you can. In fact, the permissibility is restricted by need and requirements of study and education. Added to these two conditions, you should know that it is permissible for you to stay in such a country provided that you do not fear falling in forbidden acts, such as unlawful sexual intercourse, otherwise you are required to leave. This is so since preserving one's religion takes precedence over anything else.
Allah Knows best.
You can search for fatwa through many choices