I started to teach myself because I discovered in my pre teens/teenage years that there was a world of interesting real, fresh food out there and my parents couldn't cook very well at all, we used to eat things like Dalepak grills, oven chips and frozen peas with a Mr Kipling cake for dessert.
Home Ec at school and to an extent, Guides, gave me a few basics like spag bol, chili con carne. I experimented at home myself with stir fries after buying the frozen kind and looking at the ingredients. By the time I went to university I could certainly feed myself ok, with probably 5 meals I could make without looking at a recipe book.
When I shared a house with a fellow student who was vegetarian we decided to cook together, so I bought a veggie cookbook which was full of excellent basic meals.
Then when I started to go out with now DH we often went round to PILs for meals, and his mum is an excellent cook. I observed the sorts of things she cooked. When DH and I moved in together I did most of the cooking and learned to make roast dinners - I had no idea about cooking meat much before then as though I wasn't vegetarian, veggie cooking was just easier and cheaper.
The next milestone was having DD1 - I remember not being very confident with the blender to puree meals at first, and was much better by the time DD2 came along and I had been cooking family meals for a few years. BBC Good Food 101...books really helped, plus I got the magazine for a while.
I am a very confident cook now - a few years ago I got to the stage where I could look in the cupboard or fridge and work out how to make the best of leftovers and things that needed using first, and don't use recipes much other just for ideas.
So yes, while other people have inspired and helped me it is absolutely possible to teach yourself from books and online, and just treat it as something that will improve throughout your life if you keep trying new things.