How are textbooks meant to be referenced?
I strongly disagree with Dirk. You should not "always strive to keep the number of such references in a textbook as small as possible."

Also, I would say that this: "Also keep the number of different books to which you refer as small as possible." is very poor advice.  It is a disservice to your readers, and wholly unnecessary.

Instead, you should have extensive references in a textbook whenever you draw on other materials. This is a matter of intellectual honesty and to provide your readers (and their teachers/advisers) links to source material. If your content or results come from other sources, including from textbooks, you should make explicit references to them.

Exercises are only in "the public domain" if they are from sources whose copyrights have expired or are from authors who have explicitly made them public domain, or variant thereof.

It may be advisable to have a section of your textbook that minimizes references -- mainly to improve readability.  If so, then you'd be advised to have a parallel section titled "Sources and Further Reading" where you recapitulate the content in the main section and include all references.

Dirk says that textbooks are to be "as self-contained as possible. Hence, there are few references." This is poor advice since it confuses readability with completeness and usability.  To omit references when you have copied or otherwise drawn material from other sources is both incomplete and disreputable.  It harms usability because some students and many teachers will want access to the original books and papers.