Nikolai Vasilievich Gogol is a great playwright, publicist, poet, author of many works, some of which have become the property of world literature. According to V.G. Belinsky, with Gogol a new era appeared in literature: the Russian romance and the Russian story began, how truly Russian poetry began with Pushkin.
Nikolay Vasilievich was born in Sorochintsy (now - Velyki Sorochintsy, Poltava region, Ukraine). The temple, where the writer was baptized in 1809 (Savior Transfiguration Church), has survived to our time. According to the generally accepted opinion, he was a descendant of Ostap Gogol, hetman of the Right-Bank Army of Zaporizhzhya, who took part in the anti-Polish uprising and formed rebel detachments in Mogilev-Podolsk.

The church where Gogol was baptized in 1809. Photo: Denis Vitchenko, wikipedia.org
The father of the future great writer, Vasily Gogol-Yanovsky, also had an interest in literary activity and even wrote several comedies in Ukrainian. In addition, he was a good friend of Kotlyarevsky, the author of the poem "Aeneid" in Ukrainian "mov". The Ukrainian scientist V. Zvinyatskovsky writes that Nikolai's mother, Maria Ivanovna Gogol-Yanovskaya, did not manage to master the Russian language perfectly. And the famous literary critic V.V. Gippius believed that Ukrainian was used in conversations in the Gogol family.
Thus, Nikolai Vasilievich was imbued with Ukrainian culture from childhood and was very good at language. His classmate Pashchenko testifies that at the Lyceum they played together a Ukrainian play written by Gogol himself. It is interesting that Nikolai Vasilyevich throughout his life was interested in native folklore, customs, everyday life and collected huge materials on these topics, which was directly reflected, for example, in “Evenings on a Farm near Dikanka”.

Nikolai Vasilievich's father - Vasily Gogol-Yanovsky
It is important to familiarize the reader with the situation of the Ukrainian language at that time.
There is such a thing as diglossia, which means the coexistence of two languages in one territory, which are used by their native speakers depending on a certain situation. For example, French and Russian coexisted in Russia: the first was used in high society and in business correspondence, and the second - in colloquial speech, mainly among the common people. This phenomenon was also observed on the territory of Ukraine. The Russian language was used for writing serious literature, for correspondence, and the Ukrainian language for simple communication and maximum for writing comedies. Therefore, it was impossible to break out into the world and make a serious literary career with works in "mov", on which, for example, poetry was considered bad form. That is why many works of Ukrainian writers, like Taras Shevchenko, were in Russian.
The formation of high Ukrainian culture had not yet ended, so it was simply impossible for Gogol to write serious works in his native language. He found consolation in St. Petersburg, where he discovered the interest of Russian society in Ukraine. This is somewhat paradoxical: the Russian elite had a negative attitude towards the Ukrainian language, but not towards the Ukrainian culture.
Gippius explains that, on the one hand, Ukraine belonged to Russia, and on the other, it did not. Then it was more likely a neighbor, a blood relative, who at the same time was quite exotic, such a Slavic Italy, as it was perceived in St. Petersburg. This exoticism drew Russian society to Ukraine, beckoned to get to know it better and learn its features.
In his works, Gogol borrowed a lot from the Ukrainian baroque. He used the structure of typical works of this trend and much more. His books "Evenings on a Farm near Dykanka" and "Mirgorod" are based on Ukrainian folklore. Nikolai Vasilievich praises the free nature of the Cossacks, illuminates the general picture of the struggle for independence of the Zaporozhye Cossacks, and so on. We can say that Gogol largely popularized the Ukrainian history, telling a wide audience about her exploits and features.
Gogol wrote about his nationality:
I will tell you one word about what kind of soul I have, Khokhlak or Russian, because, as I see from your letter, at one time it was the subject of your discussions and disputes with others. To this I will tell you that I myself do not know what kind of soul I have, Ukrainian or Russian. I only know that I would not have given any advantage to a Little Russian over a Russian, or a Russian over a Little Russian. Both natures are too generously endowed by God, and how on purpose each of them separately contains something that is not in the other - a clear sign that they must replenish one another. For this, the very stories of their past life were given to them unlike one another, so that the various forces of their characters could be brought up separately, so that later, merging together, make up something most perfect in humanity.
It is impossible to say to which country Gogol's activities should be attributed. His works greatly influenced both the development of Russian culture and the development of Ukrainian culture. Nikolai Vasilievich can certainly be called a Ukrainian, but it is impossible to say that he is an exclusively Ukrainian writer. He loved his small homeland with all his heart, but did not forget about his big one. Gogol wrote:
And in general Russia is getting closer and closer to me. In addition to the properties of the homeland, there is something even higher than the homeland in it, as if it were the land from which it is closer to the heavenly homeland.
It is rightly said that literature should unite, not divide.

Pushkin and Gogol