There is a list of abilities that Trace checks for, and refuses to copy. This list includes Trace itself (neatly preventing the infinite loop), along with Forecast, Multitype, Flower Gift, Zen Mode, Illusion, Imposter, Stance Change, RKS System, Disguise, Schooling, Battle Bond, Power Construct, Comatose, Shields Down, Receiver, Power of Alchemy, Gulp Missile, Ice Face, Neutralizing Gas, Hunger Switch, and As One. If you're up against any of those abilities, Trace will sit dormant without doing anything until the opponent sends out an ability that's not on that list.