The primary function/role I'd ascribe to Bombadil is almost the same same as that of the hobbits: the common man who'd like nothing more than not being bothered with The Great Game. Just with the twist that unlike the hobbits, he actually has the means to make that a reality. Everything else, the age, the powers, the mystery, it's first of all a requirement to make that role possible in Tolkien's world. That it adds depth, mystery, hn frontpage posts, that's all just a nice side effect.
Tom Bombadil predates the story of the ring. It's placed there as a very powerful creature - still would lose to Sauron if all the world fell apart according to Glorfindel [and Gandalf doesn't object either]. That creature has no direct influence on the story, being more of a bystander... similar to the reader.
Tom Bombadil is like the Middle Earth equivalent of a Buddhist sage, just existing without wishing to be more or less than he already is.