Can a woman take part in carrying the body of a dead man if there are only three men to carry it?
We tend always to give women a very restricted role when Islam has given them an equal role in life and recognized their work as very important to human society. Hence there is no difference between the duties required of men and women in worship, except for a few minor points, which are necessitated by the physical or social conditions of both sexes.
In attending to the burial of a dead person, it is preferable that men attend to the washing of the body of a dead man and women attend to those of women. But where this is not possible a husband may wash the body of his deceased wife.
In matters of burial, we have the case of Abu Tharr, the companion of the Prophet, peace be upon him, who died in a place where he was all alone with his wife and a servant. He recognized that he was dying and he gave instructions to his wife to do what is necessary for his burial except for digging of his grave. He told her to put his body by the roadside and wait until some travelers arrived. She was to tell them of the identity of the deceased and request them to help in burying him. She did so, and some travelers soon passed by and dismounted to bury Abu Tharr as he wished.
More recently, when Hassan Al-Banna, the founder of the Egyptian revivalist movement known as the ‘Muslim Brotherhood’ was assassinated by the agents of the government, no one was allowed to attend his funeral. His body was taken from his home to the graveyard, carried by his father and the women in his family. Let me tell you that the father in this case was a scholar of high repute who had done a great job in indexing and explaining the Hadith collection known as ‘Al-Masnad’ by Imam Ahmad ibn Hanbal.
The simple answer to your question is that when there is unavoidable need for someone to do something in connection with a funeral, they may do it within the limits of that need.