Burying the body of a Muslim is upon all Muslims, but if some do it, the rest will be exempt.[1] If a body has signs of being Muslim, it should be buried as a Muslim, but if there are no signs of it being Muslim, and one doesn’t know whether it belonged to a Muslim or not, it will be pak, but not all rulings of being Muslim will apply to it. There is a difference of opinion amongst the ulema as to which rulings of being Muslim apply; some say: “It is permissible to ghusl it and pray over it and bury it in the Muslim graveyard.”[2], while others believe that it shouldn’t be buried in the Muslim graveyard.[3] Yet others say that if the body was found in a Muslim state, all rulings of being Muslim apply.[4]
Related question:
Question 3642 (website: 3865) Burying a non-Muslim in a Muslim graveyard.
[1] Tawdihul-Masa’el (annotated by Imam Khomeini), vol. 1, pg. 313.
[2] This is Ayatullah Tabrizi’s fatwa. See: Tawdihul-Masa’el (annotated by Imam Khomeini), vol. 1, pg. 79.
[3] This fatwa belongs to Imam Khomeini. See: Tawdihul-Masa’el (annotated by Imam Khomeini), vol. 1, pg. 78.
[4] This is Ayatullah Zanjani’s fatwa. See: Tawdihul-Masa’el (annotated by Imam Khomeini), vol. 1, pg. 79.