Understanding the reality of things grants us a better understanding of its application. The acronym R.I.P. is derived from the burial service of the Catholic Church. Wikipedia provides it definition as, “‘Rest in peace’ (Latin: Requiescat in pace) is a short epitaph or idiomatic expression wishing eternal rest and peace to someone who has died.”
In short, it is a prayer for the deceased. In Islam, praying for the deceased is exclusively for Muslims. This is established from the Quran and demonstrated practically by Rasulullah Sallallahu Alayhi Wa Sallam in his relationship with his dear uncle Abu Talib. From the age of 8, Abu Talib fathered the orphaned Rasulullah Sallallahu Alayhi Wa Sallam. In fact he loved him more than his own children. It was Abu Talib who stood in his father’s place at his first Nikah to Khadijah. It was Abu Talib who ceaselessly sheltered Rasulullah Sallallahu Alayhi Wa Sallam from the attacks of the disbelievers. Yet at the time of his death, he refused Islam.
Rasulullah Sallallahu Alayhi Wa Sallam was naturally grieved by this and declared that he would continue seeking forgiveness for his uncle until Divine Prohibition forbade him the same. Shortly after Allah revealed the verse,
It is not right for the Prophet and those who have Imaan to ask forgiveness for the disbelievers - even if they are close relatives - after it has become clear to them they are the dwellers of the Fire (because of dying upon disbelief). (Al-Quran: Surah 9, Verse 113)
From the revelation of the verse neither did Rasulullah Sallallahu Alayhi Wa Sallam nor did any Sahaabi Radhiyallahu Anhum pray for a non-Muslim after their demise.
There is a place and at times a necessity for condolences and sympathy for the bereaved, but there is no place in Islam for praying for deceased non-Muslims. Let us not confuse these issues.