Copycat causes the user to use the last move that was used (even if the last move was by the user). A move called by Copycat in this way counts as the last move used.
Copycat will fail if the target did not make a move selection in the round before the use of Copycat, switches out during the round Copycat is used, or if the opponent's last move used was Copycat or Mirror Move. If either was used successfully, the move copied by that will be the most recent move used, and so that move will be copied by this use of Copycat.
Paralysis, confusion, recharging, and building up for a multi-turn move have no effect to the last move used. If Copycat is used against a target that was fully paralyzed or hurt itself right before its use, Copycat will still use the last move that the target used. If Copycat is used during the first turn of a multi-turn move, Copycat will use the move that the opponent used before that move (or fail if no move was previously made).
A Pokémon will be able to use a move that is disabled if it is called via Copycat.
If used in a battle after switching out, the move that is copied is the last one used within that battle.