He may need your friendship.
This kid in my school talks to himself and he also does a lot of fidgeting and he always looks around sometimes at nothing and sometimes at peoples writing utensils but the reason why I am asking this is because I want to know what's wrong with him?
There are so many possibilities. Anxiety, fear, medication side effects. It could be how he deals with being in school.
Instead of speculating, how about getting to know him? Your concern could be the beginning of a great friendship.
He could be borderline autistic or have any other mental disabilities. You should speak to your teacher and the school counselor because he needs help and the other students need to know what the problem is so that they can be understanding when he behaves like this..
I'm sure some students make fun of him and that's something that needs to be nipped in the bud.
Talk to your teacher first of all and just say you're concerned.