A woman’s advice to a foreign man
Enjoining good and stopping evil are obligations for both Muslim male and female, and they are among the Islamic responsibilities Allah gave to us. Allah says: “you are the best generation produced (as an example) for mankind. You enjoin what is right and forbid what is wrong and believe in Allah” Q4:110
The prophet (PBUH) said: “enjoin people to do good and forbid them from wrong deeds.”
Reminding man about Allah when he is committing an immoral act or when committing sins, is like stopping evil with one’s tongue. This is related to what Messenger of Allah (ﷺ) said, “Whoever amongst you sees an evil, he must change it with his hand; if he is unable to do so, then with his tongue; and if he is unable to do so, then with his heart; and that is the weakest form of Faith”.
If a woman hence stops a perpetrator with the tongue, that is forbidding evil. This act is allowed.
Finally, such act is considered an obligatory duty for every person who sees a person disobeying Allah.