My teacher is an Imam of a mosque, he used to teach Qur'an and now that I have become older and we discuss many things related to Islam.
So he recently asked me a question which I couldn't answer:
Can I dye my beard or hair black?
It's forbidden to dye beard or hair with pure black color. But it's permitted, and even recommended, to dye white beard and hair with a non-pure-black color, like something between red and black.
Dyeing hair or beard with pure black color is Haraam. This is proven by the following Hadiths:
It was narrated that Ibn 'Abbas, who attributed it to the Prophet [SAW], said: "Some people will dye their hair black like the breasts of pigeons at the end of time, but they will not even smell the fragrance of Paradise."
أَخْبَرَنَا عَبْدُ الرَّحْمَنِ بْنُ عُبَيْدِ اللَّهِ الْحَلَبِيُّ، عَنْ عُبَيْدِ اللَّهِ، - وَهُوَ ابْنُ عَمْرٍو - عَنْ عَبْدِ الْكَرِيمِ، عَنْ سَعِيدِ بْنِ جُبَيْرٍ، عَنِ ابْنِ عَبَّاسٍ، رَفَعَهُ أَنَّهُ قَالَ " قَوْمٌ يَخْضِبُونَ بِهَذَا السَّوَادِ آخِرَ الزَّمَانِ كَحَوَاصِلِ الْحَمَامِ لاَ يَرِيحُونَ رَائِحَةَ الْجَنَّةِ " .
[Sunan an-Nasa'i] and another narration in [Sunan Abi Dawud]
The Hadith above tells that people who dye their beards with black will not even smell the fragrance of Paradise, this means that dyeing with black is a forbidden thing.
Another Hadith:
It was narrated that Jabir said: "Abu Quhafah was brought on the Day of the Conquest of Makkah, and his hair and beard were white like the Thaghamah. The Messenger of Allah [SAW] said: 'Change this with something, but avoid black.'"
أَخْبَرَنَا يُونُسُ بْنُ عَبْدِ الأَعْلَى، قَالَ حَدَّثَنَا ابْنُ وَهْبٍ، قَالَ أَخْبَرَنِي ابْنُ جُرَيْجٍ، عَنْ أَبِي الزُّبَيْرِ، عَنْ جَابِرٍ، قَالَ أُتِيَ بِأَبِي قُحَافَةَ يَوْمَ فَتْحِ مَكَّةَ وَرَأْسُهُ وَلِحْيَتُهُ كَالثَّغَامَةِ بَيَاضًا فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " غَيِّرُوا هَذَا بِشَىْءٍ وَاجْتَنِبُوا السَّوَادَ " .
This Hadith reports that the Prophet recommended that we dye white hair and beard, but not with a pure black color. Another hadith that reports the recommendation of dyeing is this:
Narrated Abu Huraira: The Prophet (ﷺ) said, "Jews and Christians do not dye their hair so you should do the opposite of what they do.
حَدَّثَنَا الْحُمَيْدِيُّ، حَدَّثَنَا سُفْيَانُ، حَدَّثَنَا الزُّهْرِيُّ، عَنْ أَبِي سَلَمَةَ، وَسُلَيْمَانَ بْنِ يَسَارٍ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ قَالَ النَّبِيُّ صلى الله عليه وسلم " إِنَّ الْيَهُودَ وَالنَّصَارَى لاَ يَصْبُغُونَ فَخَالِفُوهُمْ ".
A recommended color is mentioned in this Hadith:
Narrated Abu Dharr: That the Prophet (ﷺ) said: "Indeed the best of what the gray may be changed with is Henna' and Katam." [Abu 'Eisa said:] This Hadith is Hasan Sahih. Abu Al-Aswad Ad-Dili's (a narrator in this chain) name is Zalim bin 'Amr bin Sufyan.
حَدَّثَنَا سُوَيْدُ بْنُ نَصْرٍ، أَخْبَرَنَا ابْنُ الْمُبَارَكِ، عَنِ الأَجْلَحِ، عَنْ عَبْدِ اللَّهِ بْنِ بُرَيْدَةَ، عَنْ أَبِي الأَسْوَدِ، عَنْ أَبِي ذَرٍّ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " إِنَّ أَحْسَنَ مَا غُيِّرَ بِهِ الشَّيْبُ الْحِنَّاءُ وَالْكَتَمُ " . قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ . وَأَبُو الأَسْوَدِ الدِّيلِيُّ اسْمُهُ ظَالِمُ بْنُ عَمْرِو بْنِ سُفْيَانَ .
Henna's color is red, and Katam's color is black reddish, so dyeing with both gives a color that's between red and black, but not pure black. It's also reported that Abu Bakr and Omar have dyed with Henna and Katam:
Thabit reported that Anas b. Malik was asked about the dyeing (of the hair of) Allah's Apostle. Thereupon he said.: (They were so few) that if I so liked I could count their number in his head, and he further said: (That is) he did not dye. Abu Bakr, however, dyed them and so did 'Umar dye them with pure henna.
حَدَّثَنِي أَبُو الرَّبِيعِ الْعَتَكِيُّ، حَدَّثَنَا حَمَّادٌ، حَدَّثَنَا ثَابِتٌ، قَالَ سُئِلَ أَنَسُ بْنُ مَالِكٍ عَنْ خِضَابِ النَّبِيِّ، صلى الله عليه وسلم فَقَالَ لَوْ شِئْتُ أَنْ أَعُدَّ شَمَطَاتٍ كُنَّ فِي رَأْسِهِ فَعَلْتُ . وَقَالَ لَمْ يَخْتَضِبْ وَقَدِ اخْتَضَبَ أَبُو بَكْرٍ بِالْحِنَّاءِ وَالْكَتَمِ وَاخْتَضَبَ عُمَرُ بِالْحِنَّاءِ بَحْتًا .
According to the traditions, dying hairs of head and face (beard) is Mustahab (recommended) by henna (or black colour). In fact, it is not Haram and even it is recommended in the narrations.
Imam Sadiq (a.s.) responded the question which asked about the mentioned matter that:
Is dying the hair of head and face (beard) from Sunnah?
He (Imam Sadiq (a.s.)) responded: Yes.
مُحَمَّدُ بْنُ یَعْقُوبَ عَنْ عَلِیِّ بْنِ إِبْرَاهِیمَ عَنْ أَبِیهِ عَنِ ابْنِ أَبِی عُمَیْرٍ عَنْ مُعَاوِیَةَ بْنِ عَمَّارٍ عَنْ حَفْصٍ الْأَعْوَرِ قَالَ سَأَلْتُ أَبَا عَبْدِ اللَّهِ ع عَنْ خِضَابِ الرَّأْسِ وَ اللِّحْیَةِ أَ مِنَ السُّنَّةِ فَقَالَ نَعَمْ [1].
Accordingly, it could be permissible for everyone, even for the Imam of mosque (as you asked) to dye the beard. (Since seemingly it did not mention regarding its Hormat as a Haram act for any specific group of people)
[1] حر عاملی، وسائل الشیعة، ج 2، ص 82، "بَابُ اسْتِحْبَابِ خِضَابِ الرَّأْسِ وَ اللِّحْیَةِ"، آل البیت، قم، 1409ق.
(Hor Ameli, Wasael al Shia, Vol. 2, Pg.82, Al-Albayt, Qom, 1409Lunar)
Source:
Ruling:
There is difference on whether dying hair black is permissible. Many consider it to be makruh, some consider it to be haram, some consider it to be categorically permissible, some allow it for women but forbid it to men, and some consider it haram when it is done as deception e.g. for securing marriage to someone.
According to Mawsoo‘ah al-Fiqhiyyah the Malikis, Hanafis and Hanbalis consider use of black dye on hair to be makruh. While the Shafi'is generally consider it to be haram. Abu Yusuf from the Hanafis considered it be permissible.
However, use of black dye during Jihad is considered permissible or even recommended by four schools and by the vast majority, and some have even claimed consensus on this.
Evidence for prohibition:
The evidence that it is makruh or haram are the following ahadith:
أتي بأبي قحافة يوم فتح مكة ورأسه ولحيته كالثغامة بياضا فقال رسول الله صلى الله عليه وسلم " غيروا هذا بشىء واجتنبوا السواد
Abu Quhafah was brought on the Day of the Conquest of Makkah, and his hair and beard were white like the Thaghamah. The Messenger of Allah [SAW] said: 'Change this with something, but avoid black.'"
— Muslim
The Prophet's command to avoid black suggests that it is at least makruh.
قوم يخضبون بهذا السواد آخر الزمان كحواصل الحمام لا يريحون رائحة الجنة
Some people will dye their hair black like the breasts of pigeons at the end of time, but they will not even smell the fragrance of Paradise.
— Nasai
This hadith has a severe warning which indicates that that those people commit a haram act. However it is debatable whether this hadith condemns the people because of their black dye or whether their black dyed hair is just a description of their appearance.
Evidence for permission:
This includes the hadith:
إن أحسن ما اختضبتم به لهذا السواد أرغب لنسائكم فيكم وأهيب لكم في صدور عدوكم
The best thing with which you can dye your hair is this black (dye). It makes your women desire you and creates fear in the hearts of your enemies.
— Ibn Majah - Note: classed as weak by some scholars
The use of black dye has been reported from some of the Sahaba, Tabieen and later scholars.