Olive oil is fine for cooking. You just have to be aware that it has a lower smoke point than most other common cooking oils, and pay attention to what you’re doing and not overheat it.
Heating olive oil oxidizes it. Oxidized oils are bad for your health.
A note on cooking oils.
Olive oil can be heated to a higher temperature than other oil and does not create the “varnish” on the pans that other oils do.
As an aside, the way paint varnish is made, the factory takes about 500 gallons of some sort of oil, like corn oil, soybean oil, safflower oil for example, and heats it to about 500 degrees for 8 hours. The end result is varnish to which they only add some dryers so that it will harden. It is then used to make paint or with the addition of more dryers and some other ingredients, something to varnish bare wood with.
Next time you take a look at that old frying pan with all that sticky *varnish* on it, think about that. And if you want to clean that sticky mess off your frying pan, use some lacquer solvent.
Once I realized what the *varnish* on frying pans was; I stopped using all those other oils for frying. Now it’s only olive oil.
I understand that peanut oil is very good for high temperature frying as well.