Is your child being bullied at school, after school clubs? by siblings? - this could be a factor?
also if your child is generally a sensitive person, this could be the key to what is the problem.
all you can really do is talk to your child, and let them know that you are there for them always, to talk to you when ever they want or would like to.
also you could take a visit to your doctor, and they may refer you to other services for guidance and help with this issue. also whilst at the doctor's appointment, i would advise you to explain how your child is, and how they are reacting with different situations, also about how they are eating , sleeping, toiletetaring etc..
i hope this helps, or gives you some sort of guidance into the right path to go down,
When at home do not do things which irritates him. Smile at him, do not shout or scould him. Dont not order him rather make him understand good and bad. Allow him to talk. Comfort him by taking to nearest park. When he is very emotional comfort him.
When at school its different lot of children have their own views and ideas . Ask him not to answer or listen to any of the kidding happening in the school. Rather ask him to write down what his friends told. Ask what happened in school today. Parents and kids sit together and give funny answers to the questions but meaning ful answers. Like this you can spend time with him. He will understand that somebody is there to comfort and correct him when he is wrong or alone. Make him understand things.
i have an 8 yr old who does the same thing. he has a brother who just turned 10 so they are 1.5 yrs apart and then he has a 2.5 yr old baby we got by surprise as i was tied. my 8 yr old used to be the "baby" but i' ve xplained to him that now he gets to be the big brother as he always wanted to be a big brother, but now he is very sensitive, and shuts down also,cries alot, hides out in his room, won't talk, etc. he doesn't want to go out and play with any friends in our neighborhood, so i can relate to your issues. i do his homework with him just us so he can see its our time, i have him read to me with no one around, he likes to lay next to me on our couch if the family is watching a movie, he sits next to me at dinner,and to try and get him to tell me problems hes having we go into our secret hide out where no one can hear (which is a fort in an empty part of the 2.5 yr olds closet that only he n I know about) then he tells me what happened that day at school,on the way to the bus stop, or even at home. alot of it is his teacher and his older brother whom they used to be inseparable but now he(older bro) is not wanting to hang with him anymore because he's a grade ahead and thinks of him as a tag-a-long. they share a room and my older son is being a little terd so i am trying to deal with his "i am better then everyone" attitude while helping my 8 yr old. all i can say is spend as much time with him as you can and hopefully he will see that mommy is always there to talk to no matter what. good luck!