Reading this, I could almost imagine my own father writing this for me. Now a disclaimer that I'm not a dr, and your son is probably nothing like me, but when I was in elementary school I too struggled with social anxieties (ok so I still do but I'm able to get around them more). I never felt comfortable in my own skin as it were. There were situations where I could see my friends were just fine, if not happy with handling, that just had my insides squirming. I didn't know how to make friends. I would talk to kids and they would seemingly act nice to me one day and then inexplicably turn on me the next. I was constantly made fun of and no one listened to me. A teacher I informed told me "those girls are so nice to you they would never make fun of you.Stop lying about your friends". So relying upon an outside source as to how your son is treated may not work. The acting out is probably his way to "make friends". Starting clubs or activities alone was almost impossible, even with things I loved such as sports, because of the gnawing fear and anxiety I felt over interacting with people. I would say I wanted to sign up but if a friend or parent weren't there to get me in the door the first meeting I would chicken out.
So what to do about your son? The first thing is to be patient. It will be frustrating and hard to understand at times, but in the long run you will be helping your son. It could be he just doesn't understand how to interact and read people or that he can read people, but doesn't have the wires set up to handle what he is reading. Either one can be causing the acting out in class, lack of confidence, etc.
If you talk to him it may help to setup a ground rule that he can say anything he wants to you and you will a. keep it in confidence and b. not hold it against him. Your talks with him are a neutral zone. Then follow through. Don't tell him his feelings of a certain situation is wrong, they are what he is feeling not you. Do try to give him ways to feel differently if needed or ways to handle how he is feeling. Don't tell him "you are so much smarter than me/them/it/etc" when trying to build up confidence, even if you truly feel that way it will undoubtedly make things worse. Do state how proud you are of x, y, z and why. Next time he acts out ask him why he felt he needed to. Be prepared for him to not know why, but talk to him about what he might have been feeling at the time. Was he board? Was someone egging him on? Was he anxious? He may not be able to articulate so you might have him draw what was going on or write it down as an epic story.
Try to find kids he likes and that seem to like him and invite them to join your son in activities he likes. I was much more successful in starting something if I had either a friend right there with me, for at least the first event, or my parent took me to something. Don't keep him in an activity he truly doesn't want to partake in, but if it's something he once enjoyed discuss what may have changed with him. Was it beyond his skills, is he afraid of not being good enough. Discuss with him (yea cliche's I know but very to the point) how nothing worth doing is easy and that practice makes perfect. Help him understand that things will be difficult but he can learn to cope with the hard stuff.
Give him an outlet to cope. Anxiety can arise because of emotions we can't cope with yet are smothered. Introduce him to music, art, and sports. I found running as a coping mech, but he may be drawn to music or art.Even if he doesn't have formal lessons just drawing or "playing" an instrument can help him express what he doesn't know how to verbalize. When he is at home encourage him to express himself with his outlet if he's feeling nervous.
In the end though, if things are bad, he and you may benefit from talking with someone trained to deal with anxiety disorders, particularly in children. If your pediatrician brushes you off, request a list of suggestions for a therapist anyway. A therapist visit can be an expense, but they can let you know if your son would benefit from more trained assistance, or if it's a phase he can get around on his own. This isn't for drugs and I'm of the mind that they can in some cases make things worse, but to give you more tools to help your son. He may not have a fully recognizable disorder yet, but if he doesn't learn coping mechanisms he may get worse or it could very well be just an awkward child phase.