The identity of the mysterious armoured figure is never stated outright in the game, but the widely accepted answer is Metal Sonic — not an official confirmation, just the conclusion most players reach.
The clues line up: the shell, the behaviour, and the way the character shadows Sonic's movements all point the same direction, and Metal Sonic had precedent for impersonating a hero in earlier titles.
So treat it as a strong fan consensus rather than a documented fact. Sonic games are fond of leaving exactly this kind of question unanswered, which is part of why the speculation has lasted so long.