Beware "Internet lawyering" in all of its forms. Having said that - and to be clear, I am not your attorney or giving you legal advice - I work in this area and can comment generally on what I have seen in the US.
In the US, a plaintiff asserting copyright infringement on the basis of a discussion of a single exercise in a math textbook (even if that discussion involves verbatim recitation of the statement of a problem) would be highly likely to lose, and very early in litigation. This isn't to say that a vexatious plaintiff could not cause a defendant to incur legal expenses in responding to the lawsuit. I just don't see how they would win the lawsuit. (Please note, in America, the default rule is that both sides pay their own attorneys' fees regardless of who wins. This is not the default in other jurisdictions.)
There are two main reasons for this. First, empirically speaking, factual matter - that is, content close to some kind of objective reality, where the form of how something is described might be partially dictated by bounds that are not subject to the whims of the writer - is not afforded broad protection in the US. Second, there is the doctrine of fair use.
None of this has anything to do with words that might be put by the publisher in the front of the book. I don't know of any case in which a court has found these types of recitations meaningful in assessing the boundaries of liability. It is certainly possible for somebody to become forbidden (e.g. by contract) to do something that they otherwise would have been able to do. In the US, the question of whether printed matter is effective to create legal obligations is a matter of state law, not federal law, and so can have 50 potentially different answers. But I have never seen boilerplate in the front of a textbook litigated. My guess is that I haven't seen it litigated because in most states such language would be regarded as meaningless.
I should add a few cautionary words. There is a lot of commentary about what is or is not US "fair use" as though there are settled rules in this area, and there mostly aren't. (The doctrine is codified in 17 USC 107, reflecting words largely drawn from an 1800s-era opinion by Joseph Story, but these words shed very little light on how the doctrine is applied in specific circumstances). In real life, if you get sued, you can be entirely right about US fair use but may have to spend quite a bit of money to prove it. Lawrence Lessig has described fair use as "the right to hire a lawyer," and he is not wrong about that. A lot of defendants who are not in the wrong find out that it can be cheaper to pay a settlement than it is to pay lawyers who can prove that they are right. (Some countries, not the United States, have formalized rule-bound doctrines that expressly place certain activities within a "safe" realm of non-actionable behavior. Fair use in the US is not like that - every defendant has to prove their own case.)
Despite this general indeterminacy, however, academic commentary on a math exercise is the absolute core of what the doctrine exists to protect. It isn't close. If someone asked me to file a lawsuit on that basis I would be concerned about the possibility of being sanctioned for doing so. (I would cite cases, but do not do so because I do not want this comment to resemble personalized legal advice, which it is not.)
So the broader question: what happens if we are talking not just one exercise, but a lot of exercises from the same book. In the US, it is very much within the rights of the owner of a copyright in a math textbook to use copyright claims to suppress the unauthorized distribution of a solution manual to that textbook. A plaintiff would argue that even if individual exercises exist in the realm of unprotectible "fact" (which is debatable), their selection and arrangement in a course of study is protectible expression. And there is an enormous amount of authority that a plaintiff could cite in support of that point. Unauthorized solutions manuals to copyrighted textbooks are extremely likely to be regarded as infringements of copyright. (Publishers who respond to this kind of thing with legal threats, which I have seen happen, are not just bluffing or attempting to intimidate. A cautious attorney would tell a client who wanted to distribute a full solutions manual without authorization not to do that.)
In the middle, we have the question of degree: what if someone's activity on a site includes, in bits and pieces and in various places, discussion that might in some aggregate sense resemble a solutions manual. There's no one answer. It depends! Much of what renders compilations of factual or near-factual matter copyrightable in the US (namely, originality in the form of selection and arrangement) are arguably absent from a discrete series of different questions. This is true even if some search function allows a site user to review all questions by a single user, or all posts about a specific textbook. That's what I'd argue on the defense side. I don't think such a case is a slam dunk for the plaintiff, and I would suspect the motives of anybody who said that it was. Having said that, I wouldn't want to defend such a case, either.