As for science-fiction books, Stanislaw Lem wrote a few excellent stories about AI taking over humanity back in mid-20th century.
Two short but fascinating ones are
1) Limfater’s formula
From The Investigation, written by Lem in 1959:
Once they begin to escalate their efforts, both sides are trapped in an arms race. There must be more and more improvements in weaponry, but after a certain point weapons reach their limit. What can be improved next? Brains. The brains that issue the commands. It isn’t possible to make the human brain perfect, so the only alternative is a transition to mechanization. The next stage will be a fully automated headquarters equipped with electronic strategy machines. And then a very interesting problem arises, actually two problems. McCatt called this to my attention. First, is there any limit on the development of these brains? Fundamentally they’re similar to computers that can play chess. A computer that anticipates an opponent’s strategy ten moves in advance will always defeat a computer that can think only eight or nine moves in advance. The more far-reaching a brain’s ability to think ahead, the bigger the brain must be. That’s one.”…“Strategic considerations dictate the construction of bigger and bigger machines, and, whether we like it or not, this inevitably means an increase in the amount of information stored in the brains. This in turn means that the brain will steadily increase its control over all of society’s collective processes. The brain will decide where to locate the infamous button. Or whether to change the style of the infantry uniforms. Or whether to increase production of a certain kind of steel, demanding appropriations to carry out its purposes. Once you create this kind of brain you have to listen to it. If a Parliament wastes time debating whether or not to grant the appropriations it demands, the other side may gain a lead, so after a while the abolition of parliamentary decisions becomes unavoidable. Human control over the brain’s decisions will decrease in proportion to the increase in its accumulated knowledge. Am I making myself clear? There will be two growing brains, one on each side of the ocean. What do you think a brain like this will demand first when it’s ready to take the next step in the perceptual race?”“An increase in its capability.”…“No, first it demands its own expansion — that is to say, the brain becomes even bigger! Increased capability comes next.”“In other words, you predict that the world is going to end up a chessboard, and all of us will be pawns manipulated in an eternal game by two mechanical players.”
I had also thought about the social/cultural environment of the time and how SciFi tended to lean more towards the positive side. Asimov’s 3 laws would protect us. The Twilight Zone episode of the machine Nannies that provided loving care for unfortunate children who lost their mothers. The robot in the original Lost in Space series.
Of course there was also the Forbidden Plant, but that was not some much about AI.
Maybe the original Star Trek where they showed up at the advanced vacation planet where the computers created the world based on everyone’s fantasy thoughts. Similar to the Forbidden Planet thesis but that was clearly controllable but the AI was not prepared for human minds that have somewhat uncontrolled thoughts.
But still, there seems to be something of an element of the zeitgeist of the time—is it more optimistic or pessimistic and I get the impression, on average, people are more pessimistic now than 50 or 60 years ago about what the future will bring.