In class, I'll ask you to:

Introduce yourself to me.

I'll indicate one of your classmates and ask you who they are:
Kochira wa, dare desu ka?

You'll introduce them to me:
XXX-san desu.

I'll ask a question about them:
XXX-san wa sensei desu ka?
XXX-san gakusei desu ka?

You'll answer:
Hai, XXX-san wa sensei desu.
or maybe
Iie, XXX-san wa sensei dewa nai.