The relative pronoun “who” is used, instead of “that” or “which”, when the pronoun refers to a human. However, if the pronoun is the object, then the form whom (the object form of “who”) is also grammatically correct. Using whom is considered formal and in most texts “who” is to be preferred. However, after a preposition, whom should always be used. In the two following examples “for” and “by” are prepositions.
Teachers for whom these textbooks were written were critical of the content.
A lengthy discussion of what would be considered ungrammatical, and by whom, is beyond the scope of this thesis.
[In spoken and less formal English, whom is rarely used; instead, sentences are constructed slightly differently.
Teachers who these textbooks were written for were critical of the content.
A lengthy discussion of who would consider these constructions ungrammatical is beyond the scope of this thesis.]