If you mean Sonic Generations, then yes — it is one of the better-received Sonic titles, precisely because it looks backwards. It pairs classic and modern Sonic across reimagined stages from the series' history.
If you actually meant Sonic the Hedgehog from 2006, the answer is considerably less kind. That release is widely regarded as one of the franchise's low points, held back by a rushed schedule and a long list of technical problems.
The two names are easy to mix up and the verdicts are close to opposite, so it is worth confirming before you buy either.