There is no quick fix that can be offered here and your son sounds like a very interesting young man. The easy answer for his new school would be to affix each child's name to their desk and/or for the teacher to have a bulletin board with each child's picture and name on it. I would speak to the school and his teacher in advance about this particular challenge he faces and find a way to suggest the bulletin board idea to help him as best can be done. You might also want to have a conversation with your son and then the teacher about whether the class should be told of your son's difficulty with names so they understand that he is not uncaring of their names - he just has trouble remembering them.
Learning social skills is a hard task for most children and it comes harder to some than others. Learning social skills is a task that we pursue through life and those who have the extra challenges that your son has will need extra time. Does he have friends? He might realize his mistakes if, as he loses friends or has trouble making them, he's gently and kindly reminded of the behaviors that drove the other kids away.
My own LD son used to invite children over to the house and then quickly tell them they could not touch any of his toys. He pronounced all of his toys as "special" and the guest would be allowed only to watch him play with his own toys. The child quickly asked me to take them home and the natural consequences served to slowly help my son to figure out that if he wasn't happy playing alone, he'd need to start sharing.
That your son quickly does the opposite of what an authority figure is telling him isn't to me a sign he can't remember. That's a common behavior for much younger children seeking attention that he continues to display. That should be dealt with by the authority figure who should explain in no uncertain terms that he isn't going to get cute attention when he does that as does a toddler.
The harsh reality is that before your son can be happy as you want him to be, he's probably going to have to endure some unhappiness and that can be a powerful help in helping him to learn a different way to be.
Good luck.