Help please !!

My boyfriend and I haven been going through some rough paths. So he claims that he is going through a hard time because he doesn't know what he is doing with his life. At the beginning I was being understanding, he said that he didn't want to see anyone or speak with anyone so I gave him some space but I also told him that I will always be by his side. I told him that he could talk to me for anything by bye says I can't help him and that he needs to go through it alone, I disagree. He doesn't want my help at all. He doesn't talk to me only if I text him and when I do text him he replies for 5 mins and never replies agin. Mind you he posts things on social media. I came to the point where I'm tired of all of this but I also really like him. What should I do?