Yes, indeed, it is very important to do research when you're writing fiction. And not only for historical fiction; mysteries must have accurate forensic information, horror has to follow normal physiological responses, and it is vital that sci-fi stories have a base in actual science.
Why is this so? Never underestimate the intelligence of your readers. I know a woman who not only tossed a mystery book into the trash, she refused to look at anything else he wrote--all because he didn't research the location setting. He made huge gaffes in travel time between points--too long in some cases and so short in others that Scotty would have had a hard time beaming anyone there as quickly as this guy had people driving. [Sorry, but it's physically impossible to drive from San Diego to Tucson in forty minutes, even for a speed demon like me.]
"But it's fiction," you say. No, your characters are fictional. Some of the action can be fictional. Even the location can be imaginary. But if your readers don't have some reference point in the reality they know, whether in quantum physics, technology of the era, or logistics of the setting, you will turn readers off. And once you lose that credibility with one, they will not only give you the cold shoulder, they will tell everyone they come in contact with that you are a complete idiot. And that can be many, many friends in their social media networks.
The solution is to choose your reality. For example, in my first novel the main character works in a copper mine in 1882 Bisbee, Arizona Territory. He worries about his younger brother setting charges for blasting on a different level. Problem? The real mine at that time had only one level and no vertical shafts until 1885. Solution? Make the mine a fictional one--but detail the actual procedures and technology used at the time. It puts the reader there, gives them some interesting and dangerous information, and involves them in the action.
With mystery novels, be sure to check the forensic information. If you're doing a police procedural, get the sequence of steps correct. Get a book on local poisonous creatures; you can't have a victim die within seconds of snakebite if the most dangerous one in the story's locale is a garter snake.
And speaking of getting a book, don't be afraid to go to the library and actually look up information or visit a locale to get the feel of a place. The Internet is not the know-all, end-all source of everything. In fact, those little details that can't be found on Google could be what sets your work above and beyond what's been done before.
Sharing what you learn with readers can bring them right into that world of your imagination and take them on a great ride. The amount of work you put into the reality will ensure it.