To patent or not to patent.
Your attorney should be able to address these questions for you, or at least I would think. At any rate, what I usually do with clients is that I usually recommend that they file a provisional patent application first and then they can perform market research, test the commerciability of the invention, and the like.
A provisional patent application is not costly (or, in reality, it shouldn't be). I don't know about other firms, but my firm charges $1,000 for a provisional patent application. You can retain the services of a patent attorney or a patent agent to do so. Generally, patent agents are less costly than a patent attorney. (The difference between the two is that a patent attorney, for instance, can litigate whereas a patent agent cannot. However, a patent agent can draft and file patent applications, prosecute a patent until it and if it issues, etc.)
Your attorney (or another) should also evaluate whether it is economically worthwhile to pursue a patent and/or a license.
And, another word of advice - if you intend on filing for international patent protection, I would not recommend any "marketing research" until after you have filed the provisional patent application. The US patent law provides for a 1-year "on sale bar" (with allows for market research, commerciability determinations, etc.). However, in many other countries, there is an "absolute novelty bar" and so there is no such grace period.
Hope this helps.
==
The foregoing is NOT legal advice, but rather is my best attempt to answer the question asked as a hypothetical.