How did Cohen invent forcing? A couple of popular maths book, I forget which stated that Cohen invented Forcing. 
Now, generally I've noticed that there is a history which allows one in hindsight to show that how certain techniques invented beforehand could be seen to lead upto a new technique like Forcing.
What techniques could Cohen have been influenced by to invent Forcing?
 A: I found A Beginner’s Guide to Forcing by Timothy Chow very helpful in explaining how forcing was invented. It’s online and only 16 pages long.

An important insight of Cohen’s was that it’s useful to consider what he called standard models of $ \mathsf{ZFC} $. A model $ (M,R) $ of $ \mathsf{ZFC} $ is standard if and only if the elements of $ M $ are well-founded and the relation $ R $ is ordinary set membership.

...

The somewhat counter-intuitive fact that $ \mathsf{ZFC} $ has countable models with many missing subsets provides a hint as to how one might go about constructing a model of $ \mathsf{ZFC} $ satisfying $ \neg \mathsf{CH} $. Start with a countable standard transitive model $ M $.

...

Consider a function $ F $ from the Cartesian product $ \aleph_{2}^{M} \times \aleph_{0} $ into $ 2 = \{ 0,1 \} $, where $ \aleph_{2}^{M} $ denotes the element of $ M $ that plays the role of the second uncountable cardinal. We may interpret $ F $ as a sequence of functions from $ \aleph_{0} $ into $ 2 $. As $ M $ is countable and transitive, so is $ \aleph_{2}^{M} $; we can thus arrange for these functions to be pairwise distinct. Now, if $ F $ already lies in $ M $, then $ M $ satisfies $ \neg \mathsf{CH} $.

...

However, what if $ F $ is missing from $ M $? A natural idea is to add $ F $ to $ M $ to obtain a larger model of $ \mathsf{ZFC} $, which we might denote by $ M[F] $. The hope would be that $ F $ can be added in a way that does not ‘disturb’ the structure of $ M $ too much.

The careful creation of $ M[F] $ is called forcing.
