Well, part of the problem is that there are very few textbooks that I know of which are a good introduction to formal semantics and mathematically sophisticated so as to tackle topics in algebra and topology. So I'm not too sure if you will be able to find a one-size-fits-all textbook. That being said, here are a few recommendations.
For formal semantics, you can't go wrong with L. T. F. Gamut's Logic, Language, and Meaning (Gamut is like Bourbaki, a pseudonym for a group of logicians and linguists). The first volume is an introduction to logic, with the standard emphasis on the propositional and first-order predicate calculi, but it already includes chapters on "Beyond Standard Logic", Pragmatics (with a discussion of Grice's notion of implicature), and automata. The second volume, however, is where I think Gamut really shines, with an introduction to intentional logic, categorial grammar, Montague grammar, and even Discourse Representation Theory. Of course, it does not go much in depth about particular linguistic analysis (like, say, Heim & Kratzer), but it does give you an excellent introduction to the topic.
Sadly, although rigorous, this is not very mathematically sophisticated. You could try to tackle later something like Partee, Meulen & Wall's Mathematical Methods in Linguistics, but I don't think that would satisfy your curiosity. So here are a couple of recommendations in what I think is an increasing order of sophistication.
First is Richard Kaye's The Mathematics of Logic. This is a slim volume, but action-packed, especially if you read the starred sections as well. It is introductory, but it includes a chapter on Boolean algebras (before presenting a propositional system), a section on Stone Representation Theorem, a discussion of the relation between compactness and topology, and has some nice applications of model theory. It doesn't go very far, but I think it's very nicely done and more mathematically sophisticated than most introductions at this level.
Next is Barnes & Mack's An Algebraic Introduction to Mathematical Logic, which, as the title says, is an introduction to logic that tries to do things from an algebraic point of view. So, for example, it defines a propositional language (really, a propositional algebra) as a certain kind of free algebra on the set of propositional variables, and a valuation as an algebra homomorphism (from the propositional algebra into $Z_2$). So, if you like algebra, this may be of interest.
Finally, since you mentioned model theory, I really recommend Bruno Poizat's A Course in Model Theory. This is really heavy going, though. It starts with the back-and-forth technique, begrudgingly introduces a language in chapter 2, describes structures in chapter 3 (already defining local isomorphism relations), and proves compactness in the fourth chapter by defining the topological space of complete theories of a given language and showing, via ultraproducts, that this space is Hausdorff, 0-dimensional, and compact. The next chapter introduces the space of types and $\omega$-saturated models, and chapter 6 has many applications of the theory, discussing, for example, how to prove Hilbert's Nullstellensatz in a model-theoretic setting (it shows that it is a consequence of quantifier elimination and model completeness). Chapter 7 has a really nice discussion of different theories of arithmetic (just with the successor function, with addition, and Peano Arithmetic), including a very illuminating discussion of incompleteness and an arithmetized version of the completeness theorem. This is all before starting on the real subject of the book, which is stability theory (it is basically an introduction to Shelah's main gap theorem, though, as I recall, it does not prove it).
So, as you can see, this is a very advanced book. I include it because I think those seven or eight first chapters (chapter 8 is a very nice informal discussion of ordinals and cardinals) form one of the best advanced introductions to logic, where the connections you are interested in (between logic, topology, and algebra) are put in the foreground and discussed in some depth and from a rather different point of view, one that pays as little attention as possible to the formalism. So I would definitely recommend meditating over those pages for quite some time, even if they are currently beyond your level (if they are not beyond your level of mathematical sophistication, then even better, you have just found a really good book about model theory that may match your knowledge!).
Incidentally, if you read French, Daniel Lascar's La théorie des modèles en peu de maux is written from a similar point of view as Poizat's book, but is a little more gentle, I think (but it is not for beginners either, the goal is to prove Morley's theorem that a countable theory categorical in an uncountable cardinal is categorical in every uncountable cardinal). EDIT: Oh, and I forgot. If you like the back-and-forth technique, but find Poizat's text too terse, then I recommend checking out Kees Doets's Basic Model Theory, which spends a lot of time on this technique in much simpler settings.