I am currently reading the book "An Essay on the Psychology of Invention in the Mathematical Field" by Jacques Hadamard, and one chapter in particular seem very interesting to me.
Hadamard discusses the role of imagination in mathematics, and he seems to have talked to a lot of mathematicians and scientists about this. According to him, a majority of them visualize the problems they are trying to solve as some vague image before formulating the solution using algebra and words.
He uses as an example Euclids proof of the infinitude of primes (https://primes.utm.edu/notes/proofs/infinite/euclids.html). He says he sees the finitely many primes as a confused mass, and their product $N$ as a point far away from the confused mass. $N+1$ is another point close to $N$. The prime that must divide $N+1$ is in the space between the confused mass and the point $N$ (how he visualizes the contradiction?).
Other mathematicians, like Polya, thought of the problems as words and puns before solving the problem in a rigorous manner.
This book was written in 1954, and thus, a lot of the psychology in the book is outdated (concepts like the subconscious were still controversial at the time Hadamard was writing the book). So, is there a more recent book that also covers the topic?