Enter the password 5953131313131313, then open the cheats menu and switch on tails follow.
With that enabled, Tails trails Sonic through the levels. Type the password carefully — a single wrong digit and the code won't register at all.