Bombadil is indeed an anomaly, and does not appear to fit very well into Tolkein'sTolkien's overall narrative. He comes from nowhere (although he has been there all along, unobserved), and disappears equally abruptly from the story. Unless the author has given us some hints about the character's relevance, we are reduced to speculation, so let us just consider the mechanics of the story.
TolkeinTolkien has to get the four hobbits from Crickhollow to Bree, where they will meet Aragorn, unharmed, and without Gandalf to protect them; and yet they need to have some adventures on the way, otherwise the story becomes uninteresting. Gandalf's absence is Tolkein'sTolkien's biggest problem, and so Bombadil is basically a (slightly unreliable) stand-in for Gandalf.
The hobbits are in no position to face the nine riders on their own. Neither can they just walk through the Old Forest and have a pleasant hike to Bree. So, we have Old Man Willow, which Bombadil rescues the hobbits from, and then the barrow wights, where he rescues them again, and in between these two escapades, a pleasant interlude in Bombadil's house, with Goldberry and plenty of food and rhyming verse.
I have a suspicion that TolkeinTolkien had some attachment to Bombadil. Maybe Bombadil represents the author, since he is older than any other living thing in Middle Earth, and is unaffected by the power of the One Ring, and presumably, he is also unaffected by the destruction of the ring at the story's climax. Only an author has this much power to do as he pleases in his own stories. TolkeinTolkien is, perhaps, pulling a Hitchcock on us, since the director liked to make cameo appearances in his own films.
In the Council of Elrond, Gandalf is right when he says that they cannot give the Ring to Bombadil, since he would probably just lose it. With the Ring in his own pocket, TolkeinTolkien loses the plot.