You're describing the plot of Vladimir Nabokov's The Defense (1930), in which the protagonist Luzhin (rhymes with "illusion") descends into a chess-themed monomania. This is the source of the moderately famous quotation
He sat leaning on his cane and thinking that with a Knight's move of this lime tree standing on a sunlit slope one could take that telegraph pole over there [...]
But that benign quotation comes from near the beginning of the descent. Luzhin's obsession with "defense" curdles into paranoia:
All his thoughts lately had been of a chess nature, but he was still holding on — he had forbidden himself to think again of the interrupted game with Turati and did not open the cherished numbers of the newspaper — and even so, he was able to think only in chess images and his mind worked as if he were sitting at a chessboard.
It was difficult, extremely difficult, to foresee the next repetition in advance, but just a little more and everything would become clear and perhaps a defense could be found. [...] Already the day before he had thought of an interesting device, a device with which he could, perhaps, foil the designs of his mysterious opponent. The device consisted in voluntarily committing some absurd, unexpected act that would be outside the systematic order of life, thus confusing the sequence of moves planned by his opponent. It was an experimental defense, a defense, so to say, at random— but Luzhin, crazed with terror before the inevitability of the next move, was able to find nothing better.
[...] He turned into the first available store, deciding to outsmart his opponent with a new surprise. The store turned out to be a hairdresser's, and a ladies’ one at that. Luzhin, looking around him, came to a halt, and a smiling woman asked him what he wanted. "To buy . . ." said Luzhin, continuing to look around. At this point he caught sight of a wax bust and pointed to it with his cane (an unexpected move, a magnificent move). "That's not for sale," said the woman. "Twenty marks," said Luzhin and took out his pocketbook. "You want to buy that dummy?" asked the woman unbelievingly [...] "Careful," he whispered to himself, "I may be tumbling into a trap!"
Of course (as Nabokov makes clear) this is unhealthy, and also uncommon (that's why it makes a good subject for fiction), but I'm sure it's relevant to your question that such an affliction suggested itself to an author 90 years ago. No comment as to whether Nabokov made up the idea, but certainly that guy on the Internet didn't make it up. It's a thing in the zeitgeist.