What is the purpose of: Thomas Perez, Marie, Raymond, and Salamano?
Foil: Literally a "leaf" of bright metal placed under a jewel to increase its brilliance. (Holman & Harmon 198)
In Camus' The Stranger, all of the minor characters are foils (reflections of Meursault). Traditionally, a foil is a minor character who, through comparison and contrast, serves to highlight the brilliance of the protagonist. So, Thomas Perez, Marie, Raymond, and Salamano serve to highlight the choices that Meursault makes between life and death, self-defense and murder, and responsibility and indifference.
Remember, the entire novel is told in a kind of flashback form by Meursault from his death row cell. As such, these characters are all implicit character witnesses in his actual trial and the absurd trial at large. Literally, all of them somehow condemn or damn Meursault to death because they see him as indifferent or detached from the mainstream culture. From Camus' point of view, however, these characters are all part of the culture of fatalism and non-choice: they choose death instead of life. They are agents of determinism instead of existential free will.
Thomas Perez, for example, buys into the culture of mourning so much so that he passes out from heat exhaustion. His duty to the dead body, in his mind, requires him to nearly join her in death. His absurd actions contrast heavily with Meursault's cavalier attitude during the vigil and funeral. Meursault refuses to glorify the culture of death by feeling guilt or sadness; instead, he would rather sleep, smoke, and go home. Perez and the old people in the home, however, see his freedom from death as morally reprehensible, and they judge him unfairly for it.
The others acts as foils and judges as well: Marie's testimony that Meursaut is non-committal to their relationship damns him. Raymond's testimony that Meursault helped him take revenge against his Arab girlfriend shows that Meursault is a misogynist and racist. Salamano's testimony shows that Meursault cared less about his mother than Salamano did about his missing dog. None of these characters liked Meursault's unadulterated freedom; they see his kind of freedom as reckless, to be sure.
Whereas Meursault is Camus' absurd hero (he is completely free from the materialistic culture of guilt and death), these witnesses are bound to judgments that condemn rather than condone free will.