when he is fighting sora with keyblade of ppls hearts is he posssesed by ansem or is he only influenced by him?the battle quotes and the way he talks are more riku than ansem(ex "give up yet",whixh he says many times).
He's definitely Ansem, he introduces himself as such before the battle. However Riku hasn't been kicked out of the body yet either so they're both there technically.
After the fight were Riku appears all transparent and glowy letting Donald, Goofy and Kairi escape he is kicked out of the body and Ansem takes full control.
Riku's persona was likely influencing Ansem's possession at first since the two were likely in agreement about some aspects. I mean, Ansem wouldnt have been able to get in unless Riku let him in some way, yes? Ansem takes the reigns later, but...I'm of the opinion that is both of them at first.
Ansem could be taunting Sora by using Rikus memories. That's probably why they stuck a few Riku quotes in. He's definitely been snooping around Rikus memories, at the Final confrontation he seems to know Rikus memories and feelings about destiny islands.