Who (pronoun)
The pronoun who, in English, is an interrogative pronoun and a relative pronoun, used primarily to refer to persons.
Unmarked, who is the pronoun’s subjective form; its inflected forms are the objective whom and the possessive whose. The set has derived indefinite forms whoever, whomever, and whoseever, as well as a further, earlier such set whosoever, whomsoever, and whosesoever (see also "-ever").

Etymology
The interrogative and relative pronouns who derive from the Old English singular interrogative hwā, and whose paradigm is set out below:
It was not until the end of the 17th century that who became the only pronoun that could ask about the identity of persons and what fully lost this ability."The first occurrences of wh-relatives date from the twelfth century (with the possible exception hwær (see Kivimaa 1966: 35)). The wh- form does not become frequent, however, until the fourteenth century." Notably, relative whose can still today refer to non-persons (e.g., the car whose door won't open).
The spelling 'who' does not correspond to the word's pronunciation /huː/; it is the spelling that represents the expected outcome of hwā, while the pronunciation represents a divergent outcome – for details see Pronunciation of English ⟨wh⟩. The word is cognate with Latin quis and Greek ποιός.

Uses
As interrogative pronoun
"Who" and its derived forms can be used as interrogative pronouns, to form questions:

"Who did that?"
"Who did you meet this morning?" (formal: "Who(m) did you meet this morning?")
"Who did you speak to?" (formal: "To whom did you speak?" or "Whom did you speak to?")
"Whoever could have done that?" (emphatic form, expressing disbelief)
"Whose bike is that?" (use of 'whose' as possessive determiner/adjective; see possessive and English possessive)
"Whose do you like best?" (use of 'whose' as possessive pronoun)The same forms (though not usually the emphatic ones) are used to make indirect questions:

"We don't know who did that."
"I wonder who(m) she met this morning."The corresponding form when referring to non-humans is "what" (which has the emphatic form "whatever", and no possessive form). Another similar interrogative is "which" – this can refer to either humans or non-humans, normally implying selection from a particular set, as either interrogative pronoun ("Which do you prefer?") or interrogative determiner (adjective) ("Which man should I choose?"). 'What' can also be used as a determiner ("What book are you reading?"), but 'who' cannot.
"Which", "who", and "what" as interrogatives can be either singular or plural; (examples including, "Which is the highest hill?" "Which are the highest hills?" "Who was born in 1920?" "Who were king and queen in 1920?") however, "who" and "what" often take a singular verb regardless of any supposed number. The questions "Who wants some cake?" and "What's in the bag?" do not presuppose anything about number in possible responses: "I want some cake", or "All of us want some"; and "A rabbit is in the bag", or "Five coins and a bus ticket".

As relative pronoun
The other chief use of "who" and its derivatives are in the formation of relative clauses:

"These are the men who work upstairs."
"This is Tom, who(m) I believe you have already met."
"I helped some lads whose car had broken down."The corresponding form for non-humans is "which", although "whose" can be used as a possessive in relative clauses even when referring to non-humans: "I will have to fix the car whose engine I ruined."
In restrictive relative clauses, when not preceded by a preposition, both "who(m)" and "which" can be replaced by "that", or (if not the subject of the clause) by zero. In relative clauses, "who" (like other relative pronouns) takes the number (singular or plural) of its antecedent. "Who" also takes the person (first, second or third) of its antecedent:
"I, who 'am' having a hard time right now, won't be able to help you."
"I, a tired old man who 'is' fed up with all your nonsense, refuse to help you.""Who" and "whom" can also be used to form free relative clauses (those with no antecedent). The emphatic forms are often used for this purpose: informal: "I'll take whoever you choose"; formal: "I'll take whomever/whomsoever you choose". This corresponds to the use of "what(ever)" when referring to non-humans. (For the choice between "who(ever)" and "whom(ever)" in formal English, see § Ambiguous cases below.)
The emphatic forms can also be used to make adverbial clauses, as in "Whomever/Whoever you choose, I'll be satisfied".
For more details, see English relative clauses.

Usage of "whom"
Tendency to replace "whom" with "who"
According to traditional prescriptive grammar, "who" is the subjective (nominative) form only, while "whom" is the corresponding objective form (just as "him" is the objective form corresponding to "he"). However, it has long been common, particularly in informal English, for the uninflected form "who" to be used in both cases, thus replacing "whom" in the contexts where the latter was traditionally used.
In 1975, S. Potter noted in Changing English that, "nearly half a century ago Edward Sapir predicted the demise of "whom", showing at great length that it was doomed because it was 'psychologically isolated' from the objective pronouns me, us, him, her, them on the one hand, and the invariables which, what, that and where, when, how, why on the other." By 1978, the 'who'–'whom' distinction was identified as having "slipped so badly that [it is] almost totally uninformative". According to the OED (2nd edition, 1989), "whom" is "no longer current in natural colloquial speech". Lasnik and Sobin argue that surviving occurrences of "whom" are not part of ordinary English grammar, but the result of extra-grammatical rules for producing "prestige" forms.According to Mair, the decline of "whom" has been hastened by the fact that it is one of relatively few synthetic (inflected) remnants in the principally analytical grammar of Modern English. It has also been claimed that the decline of "whom" is more advanced in the interrogative case than in the relative case, this possibly being related to the degree of complexity of the syntax.However, some prescriptivists continue to defend "whom" as the only "correct" form in functions other than the subject. Mair notes that: "'whom' is moribund as an element of the core grammar of English, but is very much alive as a style marker whose correct use is acquired in the educational system [, where it is taught]. [The use of "whom"] is highly restricted, but rather than disappear entirely, the form is likely to remain in use for some time to come because of its overt prestige in writing."Whom is also sometimes used by way of hypercorrection, in places where it would not even be considered correct according to traditional rules, as in "Whom do you think you are?" For more examples see the § Ambiguous cases section below.
Retention of the 'who'–'whom' distinction often co-occurs with another stylistic marker of formal or "prestige" English – avoidance of the stranded preposition. This means that "whom" can frequently be found following a preposition, in cases where the usual informal equivalent would use who and place the preposition later in the sentence. For example:

Formal: "To whom did you give it?"
Informal: "Who did you give it to?"In relative clauses, movement of the preposition further allows "who" to be replaced by "that" or removed entirely:

Formal: "He is someone to whom I owe a great deal."
Informal: "He is someone who I owe a great deal to", or "He is someone that I owe a great deal to", or "He is someone I owe a great deal to..."

Usage of "who" and "whom"
In the types of English in which "whom" is used (which are generally the more formal varieties, as described in the section above), the general grammatical rule is that "who" is the subjective (nominative) form, analogous to the personal pronouns "I", "he", "she", "we", "they", while "whom" is the objective (oblique) form, analogous to "me", "him", "her", "us" and "them". Thus, "who" is used as a verb subject, while "whom" is used as an indirect or direct object of a verb or as the object (complement) of a preposition.
Examples:

As verb subject: "Who is waiting over there? Tom is someone who works hard" (original sentence, before being changed to a clause: "'He' works hard.")
As verb object: "Whom do you support? She is someone whom many people admire." (original sentence, before being changed to a clause: "Many people admire 'her'.")
As preposition complement: "On whom do you plan to rely? These are the players of whom I am most proud." (original sentence, before being changed to a clause: "I am most proud of 'them'.")Notice that in a relative clause, the form depends on the role of the pronoun in the relative clause, not that of its antecedent in the main clause. For example, "I saw the man who ate the pie" – not "whom", since "who" is the subject of "ate" (original sentence, before being changed to a clause: "'He' ate the pie"); it makes no difference that its antecedent "(the) man" is the object of "saw".
In the position of predicative expression, i.e. as the complement of forms of the copula "be", the form "who" is used, and considered correct, rather than "whom". (Compare the case of the personal pronouns, where the subjective form is traditionally considered correct, although the objective forms are more commonly used – see English personal pronouns § Case usage.)

"Who were those people?"
"Who is this?", or "Who is it?" Compare: "It is I" (formal, and traditionally correct) to "it is me" (informal, but now common usage).In the examples that follow, notice how, when the verb is a form of "be", the question "Who is the captain of the team?" or the noun clause "who the captain of the team is" (we know it is a noun clause because it replaces the word "something") is the same regardless of whether the original placement of the unknown person was before or after "be" (is):

She asked something. John is captain of the team.
Interrogative: She asked, "'Who' is captain of the team?"
Noun clause: She asked "who the captain of the team is".
She asked something. The captain of the team is John.
Interrogative: She asked, "'Who' is captain of the team?"
Noun clause: She asked "who the captain of the team is".

Ambiguous cases
A problem sometimes arises in constructions like this:

"Beethoven, 'who' you say was a great composer, wrote only one opera."Use of "who" here is normal, and to replace it with 'whom' would be grammatically incorrect, since the pronoun is the subject of "was", not the object of "say". (One would write "You say [that] 'he' [not 'him'] was a great composer".) Nevertheless, "whom" is quite commonly encountered, and even defended, in sentences of this type. It may arise from confusion with a form like:

"Beethoven, whom you believe [or "whom you believe to be"] a great composer, wrote only one opera."In this case, "whom" is used correctly according to the traditional rules, since it is now the object of the verb "believe". (One would write "You believe him [not 'he'] (to be) a great composer.")
The use of "whom" in sentences of the first type ("Beethoven, whom you say was a great composer...") – referred to as "subject 'whom'  – can therefore be regarded as a hypercorrection, resulting from awareness of a perceived need to correct "who" to "whom" in sentences of the second type. Examples of this apparently ungrammatical usage can be found throughout the history of English. The OED traces it back to the 15th century, while Jespersen cites even earlier examples from Chaucer. More examples are given below:

Young Ferdinand, whom they suppose is drown'd, [...] (Shakespeare, The Tempest, III, 3)
[...] going to seek the grave / Of Arthur, whom they say is kill'd to-night / On your suggestion. (Shakespeare, King John, IV, 2)
[...] the rest of their company rescued them, and stood over them fighting till they were come to themselves, all but him whom they thought had been dead; [...] (Defoe, The Further Adventures of Robinson Crusoe, Chapter 6, Part 1. Use of whom here may be due partly to the proximity of him.)
But if others were involved, it was Harris and Klebold whom students said seemed the tightest, who stood apart from the rest of their clique. (From The Age newspaper, Melbourne, Australia, April 1999, in an article syndicated from the Washington Post. The original article had the "correct" who. Note that the continuation with the parallel construction who stood apart illustrates how the use of subject whom can lead to inconsistencies.)
He saith unto them, But whom say ye that I am? (King James Bible, Matthew 16:15. Technically whom here is not a subject, but the complement of the copula am; but in this position too it is who that would be expected according to the traditional grammatical rules as given in the section above, as it would be in Who am I?)Doubts can also arise in the case of free relative clauses, formed with who(m), who(m)ever or who(m)soever. Modern guides to English usage say that the relative pronoun should take the case appropriate to the relative clause, not the function performed by that clause within an external clause. For example, it is correct to write I'll talk to whoever [not whomever] will listen, since whoever is the subject of will listen (regardless of the fact that the entire clause whoever will listen serves as the object of the preposition to). On the other hand, Whomever you choose will suit me is correct, since whomever is now the object of choose (despite the fact that the entire relative clause is the subject of will suit).Similarly:

Let whoever is without sin cast the first stone. (In the internal clause, whoever is the subject of is.)
Whom you choose will be placed on this list. (In the internal clause, whom is the object of choose.)In sentences of this type, however, as with the "subject whom" examples above, use of whom(ever) is sometimes found in places where it would not be expected grammatically, due to the relative complexity of the syntax. In fact in Middle English it was standard for the form of the pronoun to depend on the function in the external clause; the modern rule came about through re-analysis of the pronoun as primarily an element of the internal clause.

Usage of "whose"
"Whose" is the genitive case of "who".

The boy whose name I don't remember came from Japan.Unlike the other forms of "who", relative "whose" (but not interrogative "whose") can still refer to non-persons, in the way that all forms of the word could in Old and Middle English.
The cars whose door won't open.

Notes
Bibliography
Glenn, Loretta; Gray (2007). The Writer's Harbrace Handbook, Brief. Cengage Learning. p. 339. ISBN 978-1-4130-3060-0.
Jespersen, Otto (1965) [1924]. The Philosophy of Grammar. New York City: Norton. appendix. ISBN 0-226-39881-1.
Brinten, L.; Arnovick (2009). The English Language: A Linguistic History. Oxford: Oxford University Press.
Mair, C. (2009). Twentieth-Century English: History, Variation, and Standardization. Cambridge: Cambridge University Press. ISBN 978-0-521-83219-9.
Potter, S. (1975). Changing English. London: The Trinity Press. ISBN 0-233-96648-X.
Arts, F. (2004). "Relative Who And Whom: Prescriptive Rules And Linguistic Reality". American Speech. 69 (1): 71–79. doi:10.2307/455950. JSTOR 455950.
Yoko, I.; Y. Michiko (2009). "Relative and Interrogative Who/Whom in Contemporary Professional American English". Germanic Languages and Linguistic Universals: 177–191.
Lasnik, Howard; Nicholas Sobin (2000). "The who/whom puzzle: On the preservation of an archaic feature". Natural Language and Linguistic Theory. 18 (2): 343–371. doi:10.1023/A:1006322600501. S2CID 169543996.
Safire, William (7 October 1990). "On Language; Shnorring the Burden". The New York Times Magazine. Retrieved 15 June 2009.
Wanner, Eric; Michael Maratsos (1978). "An ATN Approach to Comprehension". In Halle, M.; Bresnan, J.; Miller, G. (eds.). Linguistic theory and psychological reality. Cambridge, MA: MIT Press. p. 133. ISBN 978-0-262-58043-4.