Is it permissible for a Muslim to attend the funeral of a non-Muslim friend if it is in the church, as a sign of respect for the deceased?.
It is not permissible for the Muslim to attend the funeral of a kaafir or to enter their churches, even if that is a sign of respect etc, because attending the funeral is a way of showing love and respect, and it is not permissible to show that towards a kaafir, according to the correct view.
Moreover the questioner says, “to attend the funeral of a non-Muslim friend” – but it is not permissible for a Muslim to take a kaafir as a friend, because Allaah has commanded us to regard them as enemies, to shun them and to keep away from them. This does not mean that we should not deal with them or buy and sell or form business partnerships with them. That is one thing, and taking them as friends is another thing. Allaah says (interpretation of the meaning):
“You (O Muhammad) will not find any people who believe in Allaah and the Last Day, making friendship with those who oppose Allaah and His Messenger (Muhammad), even though they were their fathers or their sons or their brothers or their kindred (people). For such He has written Faith in their hearts, and strengthened them with Rooh (proofs, light and true guidance) from Himself. And He will admit them to Gardens (Paradise) under which rivers flow, to dwell therein (forever). Allaah is pleased with them, and they with Him. They are the party of Allaah. Verily, it is the party of Allaah that will be the successful”
And the Prophet (peace and blessings of Allaah be upon him) said: “Do not initiate the greeting of salaam with the Jews and Christians, and when you meet them in the street, force them towards the narrowest part of it.” Narrated by Imam Muslim in his Saheeh, 2167 from the hadeeth of Abu Hurayrah.