Let me make sure I understand your question. You said " Is it necessary to go to school when I could learn what I want online? Do I have to school before I make it in life?"
My understanding of your question is, "Why should I pay to go to school, when I can learn most everything I need to know to be successful in life by taking free online classes?"
Did i capture what you were trying to ask?
I agree with the three other responses, but let me add a little bit.
Yes you can learn the equivalent of a college degree by taking free online classes such as:
http://ocw.mit.edu/index.htm or https://www.khanacademy.org/
If you finish each class successfully, you will have the knowledge that regular learners have who take the classes. You may even successfully finish enough classes to get the equivalent knowledge of a college degree.
But would you finish successfully?
And if you finished successfully, how could you prove to someone, in one sentence, that you had that same knowledge that those who had the college degree had?
Individual online learning takes a lot of self discipline. The best online classes don't leave it up to the individual to discipline themselves. The classes are taught with a group of students taking the class at the same time, so they can interact with one another and give each other feedback and encouragement, and so the class progresses as a group to the end. There are deadlines that everyone has to meet at the same time.
Then there is this thing called accreditation. Schools strive to be accredited by accreditation institutions so that the rest of the world knows, in one sentence, that if you got the degree from MIT, or from Cambridge, that it means something. Teachers work hard to put their courses together in a way that effectively helps the learner to learn the material. The accreditation organization looks at all the courses in a degree program and if they agree they contain the right material and are taught effectively, then the degree program is accredited. Read more about it at https://en.wikipedia.org/wiki/Educational_accreditation.
So while it is theoretically possible, it is not a good idea. You have a very high risk of not successfully completing your goal without help from others who are committed to helping you succeed (like the teachers, the other students and the support people at the school). And you get what you pay for. If you don't pay the teachers and the schools and the accreditation organizations, you don't get the same recognizable high-quality degree as those who do. Like Ollie Jones said above, if you want to be a pioneer and are up the challenge of convincing others you have a good education, go for it. For me and my time, it is easier to earn the money and pay for the classes. Even if most or all of the classes are online.
Check out this school for a really good online program, that is a very reasonable cost. It has the advantage that while it is online, there are local groups of students and advisors who meet weekly face-to-face and support each other. The downside is, it is not available in all locations and there are some pretty strict rules that go along with it. BYU Idaho Pathway