In both cases you have to use “months”
The meaning changes though: “few” specifically means very little, often less than what you expect. “A few” simply means “not many”
I started speaking Italian after only few months of study. After a few months my writing began to improve as well.