Even older kids... will write backwards, per letters and numbers.
So, your son is not unusual.
He is only 5.
My son is 5. He is in Kindergarten. Public school.
He knows his letters and numbers and the sounds of the alphabet and does sight words and reading per his ability, and knows writing and counting past 200, and they have foreign language classes/social studies/science/computer lab class, etc.
But with writing, of course at this age, penmanship is not all neat and perfect and like an older child.
Normal. Per this age. And per his Teacher as well.
As far as attention... kids this age are young. And I highly doubt, your son is the ONLY one, that flits around or sometimes does not pay attention.
Or, sometimes they are bored. Hence their mind wanders.
Kids this age, are not 100% on point with attention. So keep that in mind.
Perhaps, ASK your son, "why" he acts like he doesn't know the sounds of the alphabet (because you said you know he does know it). So, in a casual manner, just ask him why, he makes like he does not know it?????
See what he says.
Each school and per their curriculum, they have benchmarks or levels of skills which each grade/age, needs to learn and master.
And per these benchmarks, the Teacher/school will know which kids are meeting those 'requirements' or not.
What is the school's... expectation per his age/grade and their curriculum????
And, what is the Teacher doing, to help your son?
Because, in each class/grade, there are kids who are of ALL varied levels of ability or competence.
And sometimes, something as simple as the child being tired... or hungry, affects their attention spans. Especially with young children like this.