Our prophet is recorded dyeing his hair yellow khaluq(Nasai 5088), red henna (Bukhari 166) and red-black katam, which in combination with henna is his preferred hair dye (Ibn Majah 3622, 3623).
Muhammad forbade pure black (presumably soot) and gave no recorded reason for this prohibition. Scholars argue that it must be because dyeing hair black involves deception. While possible, it can also be because it involves using a product created by fire, which Muhammad states, even on Earth, originates from Hell. (Muhammad also states that one must perform ablution after eating food touched by fire.)
In any case, by dyeing grey hair, a symbol of old age, Muhammad is giving himself a more youthful and hip appearance by “changing the creation of Allah.”
Allah’s goal, as stated in Quran 9:29, is to have those non-Muslims unwilling to convert be a) murdered, or b) extorted and humilated (jizya). To facilitate this kind of inhumanity, it is important that Muslims not empathize with non-Muslims.
To prevent empathy, Muhammad, most blatantly, forbids Muslims from associating with non-Muslims (Abu Dawud 4832). More subtley, he has Muslims dress and act differently than non-Muslims, with the sole stated reason being to differ from them. Some examples include clothes color (Muslim 2077a), praying in shoes (Abu Dawud 652), fasting Ashura (Abu Dawud 2445), and funeral customs (Abu Dawud 3176)
There is also a famous hadith (Abu Dawud 4031): "Whoever imitates a people, he is one of them." However, its authenticity is contested, with it classed hasan sahih by al-Albani and daif by al-Arna'ut.