How to do market research for startups

When I started my first software company, market research for startups wasn’t a topic that was discussed at any great length, and as such, I had to figure it out on my own.