You can start from your examples:
Who(m) did you teach play the guitar?
and
Who taught you how to play the guitar?
In the first example, who, or rather whom, is an interrogative pronoun in the accusative case, which, syntactically, is a direct object. So, here, you will simply have your student translate the English who into Russian and then select from its declension paradigm the form appropriate for the accusative case; then, finally, have him / her answer the question like this: You taught Ivan to play the guitar, in which case, as in the initial question, Ivan, which refers to who(m), would also be in the accusative case.
As to the second example, have your student do the same as in the case of your first question. When, again, he / she answers the question by saying, Ivan taught you to play the guitar, your student will notice that a. Ivan once again refers to who in the question, and that b. unlike in the case of your first question, both who and Ivan are now in the nominative case because, syntactically, they are subjects.
In conclusion, on doing the replacement test:
Who taught you how to play the guitar?
turns into
Ivan taught you how to play the guitar.
As you can see, when doing this replacement test, the initial sentence, though interrogative in form, remains unchanged in its affirmative form. All that changes is who which gets replaced by Ivan.