Who Should Lead The Janazah Prayer?
Question

If the deceased appointed someone to lead the funeral prayer for him after his death, does he take precedence over the Imam of the mosque in that case?
Praise be to Allah.The one who is most entitled to lead the funeral prayer over the deceased is the Imam of the mosque , whether or not the deceased left instructions that a particular person lead the funeral prayer over him. If the Imam of the mosque gives up that right and allows the one whom the deceased had named to lead the prayer, there is nothing wrong with that. But if he holds onto his right, then he has the right to do so, because of the Hadith of Abu Mas`ud Al-Ansari (may Allah be pleased with him), in which it says: “…No man should lead another man in prayer in his place of authority, or sit in his place of honour in his house, without his permission.” 
It was narrated that Salim ibn Abu Hafsah (may Allah have mercy on him) said: 
“I heard Abu Hazim say: I was present on the day Al-Hasan ibn `Ali died, and I saw Al-Husayn ibn `Ali poking Sa`id ibn Al-`As in the shoulder and saying: Go forward (to lead the prayer); were it not that it is Sunnah, you would not be asked to go forward.” 
Salim is a weak narrator, but a similar report was narrated by An-Nasa’i and Ibn Majah with another chain of narrators from Abu Hazim. Ibn Al-Mundhir (may Allah have mercy on him) said in Al-Awsat: There is no Hadith of a higher category concerning this matter apart from this, because the funeral of Al-Hasan (may Allah be pleased with him) was attended by a large number of the Sahabah and others.” (Talkhis Al-Habir, 2/88 by Ibn Hajar). 
It says in Fath Al-Qadir (2/117): 
“The one who is most entitled to lead the funeral prayer for the deceased is the ruler, if he is present, because giving anyone else precedence over him is a kind of disrespect towards him. If he is not present, then the judge should lead the prayer, because he is in a position of authority. If he is not present then the Imam of the neighbourhood should lead the prayer , because the deceased accepted him (as Imam) when he was alive. Next in order of preference comes the next of kin…”
Shaykh Ibn Baz (may Allah have mercy on him) was asked: 
If the deceased had left instructions that a particular person should offer the funeral prayer for him, does this person take precedence over the regular Imam? 
He replied: 
“The regular Imam is more entitled to offer the funeral prayer than the one whom the deceased had requested, because the Prophet (blessings and peace of Allah be upon him) said: “No man should lead another man in prayer in his place of authority”, and the Imam of the mosque is the person of authority in his mosque.” (Majmu` Al-Fatawa, 13/137) 
And Allah knows best.