Sonic would probably be very shocked at first. He trusts Amy, so her betrayal would be unexpected. He might initially try to talk to her to understand why she did it.
One common theme is trust. When Sonic is betrayed, it shatters the trust he had in his friends or allies. This often leads to a journey of rebuilding that trust or finding new trustworthy companions.
One popular 'sonic gets betrayed fanfiction' might be 'Sonic's False Friends' where Sonic is wrongly accused by his comrades due to a misunderstanding created by Dr. Eggman's devious plan. In this fic, Sonic has to fight not only his real enemies but also the distrust of his friends.
In this kind of fanfiction, it might be that Amy thinks Sonic has been hiding secrets from her. These secrets could be something she believes are harmful to their friends or the world they live in. So she decides to betray Sonic in order to protect everyone else. Sonic would then be left confused and hurt, having to figure out how to fix the situation.
Well, often in such a 'ash gets betrayed fanfiction', the story might start with a seemingly normal day for Ash. Then, out of the blue, someone he trusts deeply, like Pikachu or one of his human friends, does something that he perceives as a betrayal. This could be something as simple as not believing in him during a crucial battle or siding with an enemy for a reason that's not clear to Ash at first. It can create a lot of emotional turmoil for Ash and make for a very engaging read.
I'm not sure specifically as there could be various interpretations in such a fanfiction. Maybe Metal Sonic sets Sonic up in a way that makes Sonic look bad to the other characters, perhaps by faking some evidence or causing chaos and making it seem like Sonic's fault.
Positive Sonic fanfiction could be about Sonic mentoring the younger characters like Tails and teaching them important life lessons. Or it could be about Sonic and his friends having to solve a mystery in their world, like a strange disappearance of an important item or character. Fanfictions that show the characters growing and evolving in positive ways, such as Amy becoming more confident in her own abilities, are also excellent alternatives to inappropriate fanfiction themes.
One possible reason for Ash getting betrayed in the fanfiction could be misinformation. A villain might spread false rumors about Ash, making his friends believe he has done something wrong. His friends, without verifying the truth, turn against him. It's a sad situation where lack of communication and trust plays a big role.
It could be Dr. Eggman. He's always been after Sonic and trying to defeat him. Experimenting on Sonic could be his new way to find Sonic's weaknesses or to gain his powers for himself.