This is an Islamic law called "ENJOINING GOOD & FORBIDDING EVIL"
in countries without Islamic government this is not done by government but Muslims should advice each other.
The Holy Qur'an enjoins us again and again to do amr-bil-ma'roof
and
nahya 'anil munkir
. In suratul aale-Imran Allah says:
You are the best community raised up for mankind. You enjoin right conduct
and forbid evil (you do amr-bil-ma'roof and nahya 'anil munkir) and you
believe in Allah."[3:110]
Please also see the ayah [3:104], [9:71] and [31:17].
At the same time Islam safeguards an individual's right to privacy in the
strongest possible terms. In suratul Hujaraat Allah says:
"O you who believe! Avoid much suspicion, for indeed suspicion (in some
cases) is a sin. And spy not, nor backbite one another. Would one of you
like to eat the flesh of his dead brother?" [49:12]
Amr-bil-ma'roof and nahya 'anil munkir inevitably involve encroachment
upon some one's right to privacy. Where the exercise by an individual of
his right to privacy is likely to adversely effect the right of another
individual or a group or the ummah or the mankind, that right of privacy
is forfeited and the ummah has the duty to counsel that individual.
A few ahaadeeth on the subject are worth noting:
The Holy Prophet (SAWAW). has said :The world is like a ship and mankind
its passengers. The welfare of all depends upon the safe conduct of each.
If anyone is found making a hole on the side of a ship, he must be
stopped.
The Holy 5th Imam (AS) "Amr-bil-ma'roof and nahya 'anil munkir are the
most important obligations because upon them depend the performance of
all other obligations. If amr-bil-ma'roof and nahya 'anil munkir are done
the earth will become a safe place, enemies will be subdued and all other
affairs discharged satisfactorily"
The Holy Prophet (SAWAW) said "He who does amr-bil-ma'roof and nahya
'anilmunkir is the vicegerent on the earth of Allah, His Prophet and His
Book."
Addressing the Muslim scholars in Mecca after he had left Madinah on his
way to Kerbala, Imam Hussain (A.S.) remonstrated with them because of
their failure to do amr-bil-ma'roof and nahya 'anil munkir. This is a
very long hadith and is reported in Al-Tawhid Vol.VII, No.4 p.41. It also
explains Imams's stand against Yezid. I request the administration to
arrange to post the Hadith.
Now let us revert to your specific concerns. The fuqaha are all agreed on
an individual's duties with regard to amr-bil-ma'roof and nahya 'anil
munkir and the difficulties one often confronts. I am assured that
Ayatullah Khameni's views coincide with those of Ayatullah Ruhullah
Khumaini and marhum Ayatullah Khui, upon whom I have mostly relied.
Amr-bil-ma'roof and nahya 'anil munkir are wajib-e-Kifaai. If one person
does it, it is saqit on the others. If no one does it all are equally
accountable, regardless of their financial or social status, provided the
following requirements are met:
(a) he himself is aware of what is good and what is bad from the Islamic
point of view;
(b) he believes that the person to whom he wishes to do amr-bil-ma'roof
and nahya 'anil munkir will listen and follow the advice. If he is
satisfied that the person will not under any circumstances listen to the
advice, it is then not wajib upon him to do amr-bil-ma'roof and nahya
'anil munkir to that person;
(c) he is satisfied that by his undertaking to do amr-bil-ma'roof and
nahya 'anil munkir no personal or financial suffering will be caused
to a third party.
Ways of doing amr-bil-ma'roof and nahya 'anil munkir:
(a) By tongue. By talking to the person and persuading him, using the
politest posible language to start off with.
(b) By conduct. If talking produces no result, a gradual withdrawal of
friendship and companionship should be resorted to.
(c) (in Islamic Government) The next stage should be to report the matter to 'alam-e-shar'a (the
mujtahid whose muqallid you are or his duly appointed "wakil" authorised
to decide jurisprudential matters).
References:
http://www.islamic-laws.com/AmrBilMaroof.htm
http://www.al-islam.org/organizations/aalimnetwork/msg00304.html