Answer:
D. whom
Step-by-step explanation:
Only "whom" can be used as object to a preposition, in this case, "with" is the preposition.
A quick way to double check is to replace who and whom with he and him respectively and see which one fits better. In this example, we would have "I went to the play with him".