With regard to functionality, that's a very open question. We're constantly finding that features that didn't seem useful are not just functional but important. This trend can be seen at multiple levels, from gut flora to "junk DNA."
As for what fraction of our genome is either shared with other non-human organisms or originated with them, it's tough to find a straight answer on that, but rest assured it's far from zero. See https://www.cshl.edu/the-non-human-living-inside-of-you/ . That's been well-understood by everyone other than religious fundamentalists for some time now, and there are countless legitimate sources that can be cited.
Still, related to the importance of bacteria, while I don't doubt that, as we learn more, we will discover that they have a bigger role than even dreamed 50 years ago, you still can't compare it to the basic roles of human organs. We have actually created microorganism-free mice and other organisms, and while they are not very healthy, they are fully functional (with bad digestion and big immune problems): https://en.m.wikipedia.org/wiki/Germ-free_animal