To what extent do books on Halachah have authority? I was taught that the Gemara was "closed" and may no longer be challenged in terms of its Halachic authority. To what extent is this authority binding, and when can it be overruled (if at all)?

In the same vein, I would like answers to the question pertaining to the Halachic authority of the Geonim, Rishonim and Aḥaronim.

Finally, does this authority carry over to modern books? If I have a book on Kashruth that cites the Mishnah Berurah and/or Shulḥan 'Aruch and maybe a couple of other sources that "have authority", does that mean I have to follow what this book says? Is there no room to find another opinion?