Part (a)
Label the doors A, B, C.
If a person goes through door A, then they have 2 choices (B or C) to pick as an exit. Similarly, if they go through door B, then they have 2 choices for an exit (A or C). Finally, if they go through door C, then they have 2 choices for an exit (A or B).
We have 3 choices for the entrance, and 2 choices for the exit.
So overall, 3*2 = 6 different combinations are possible.
Those 6 combos are
AB, AC, BA, BC, CA, CB
Answer: 6
=============================================
Part (b)
This is effectively the same as part (a), but we can now re-use the entrance door. For any door we enter, we have 3 choices to pick from for the exit. There are 3 doors, so 3 entrances and 3 exits, meaning 3*3 = 9 different combinations.
Those 9 combos are
AA, AB, AC, BA, BB, BC, CA, CB, CC
Answer: 9