There is no mention of Hobbits wearing hats in the Lord of the Rings
I have searched my copies for the words "hat" and "hats", and never are the Hobbits mentioned to be wearing hats during the events of the Lord of the Rings.1 As such, it seems unclear whether or not they were wearing or weren't wearing hats.
NB: This does not mean that Hobbits, in their daily lives did not wear hats, such as the Shirrifs pointed out by Valorum.
There are two characters in the Lord of the Rings that wear hats. Namely, Gandalf and Tom Bombadil.
There was another burst of song, and then suddenly, hopping and dancing along the path, there appeared above the reeds an old battered hat with a tall crown and a long blue feather stuck in the band.
Book 1, Chapter VI: The Old Forest
Arrows fell among them. One struck Frodo and sprang back. Another pierced Gandalf’s hat and stuck there like a black feather.
Book 2, Chapter V: The Bridge Of Khazad-dûm
Gandalf's hat is mentioned a few more times in The Two Towers, with no mention of hats in the Return of the King, before the chapter Many Partings.
The only mention of Hobbits and hats are the following three:
'Don’t let your heads get too big for your hats! But if you don’t finish growing up soon, you are going to find hats and clothes expensive.’
Book 6, Chapter VI: Many Partings
He opened an eye and tried gallantly to smile. ‘Who’s this young giant with the loud voice?’ he whispered. ‘Not little Pippin! What’s your size in hats now?’
Book 6, Chapter IX: The Grey Havens
Sam's felt "hat"
In Three is Company, before Pippin, Frodo and Sam set out for Frodo's new home, Sam appears with a "tall shapeless felt bag" on his head, which he calls a "hat". This is quite an interesting point, given the difference in status between the other two adventurers, Pippin and Frodo, and Sam. Sam is a lower class, more simple Hobbit. Gardener for Frodo, Sam may have chucked on the felt bag to feel more akin with his fellow travellers, who would have normally been seen with a cap of some kind.
Similarly, in the History of the Lord of the Rings, apart from the earliest works, the story talks of no mention of hats being worn by the Hobbits in the Fellowship. Although there is a very early version of the tale, where Frodo wears the Ring to escape from Maggot, and in the process temporarily steals Farmer Maggots hat.
Bar this, there is no mention of the Hobbits adventuring with a hat.
Some pictorial evidence from renowned Tolkien artists Alan Lee and John Howe, which may help shape viewpoints, show that the Hobbits likely were not wearing hats during their adventures:

More examples can be found below:
Grey Havens - Alan Lee, The Taming of Smeagol - Alan Lee, Shelob and Frodo - John Howe, Weathertop on the Horizon - John How, Against the Shadow - John Howe, Amon Hen - John Howe
1 Did you search your copies for homburg, fedora, bycocket or bicoket, bicorne or tricorne, chapeau, bonnet, beret, biretta, boater (I just know there was a straw boater in Bored of the Rings), bowler, capotain, caubeen, cloche, deerstalker, fez, gatsby, hardee, kofia, porkpie, shako, slouch, taqiyah, toque, trilby, vueltiao, or any other of the numerous kinds of hats that do not bear 'hat' in their name? ;)
Comment by @Lexible
Based on this comment by @Lexible, stating my search terms were far too limited, I dove deeper, my results are below:
Homburg, Fedora, Bycocket, Bicoket, Bi/Tricorne, Chapeau, Bonnet, Beret, Biretta, Boater, Bowler, Capotain, Caubeen, Cloche, Deerstalker, Fez, Gatsby, Hardee, Kofia, Porkpie, Shako, Slouch, Taqiyah, Toque, Trilby, Vuelito: 0