Texbooks can be used for:

 1. Self-study. In this case they have a healthy dosage of theoretical
    material and a bunch of exercises, which have answers.
 2. Guided study, when the teacher explains theoretical material, shows
    how to solve exercises and then checks and grades homework and
    classwork. Some of these textbooks come in two flavors: for students
    and for teachers, in this case the teachers' version has answers and
    some additional guidance.
 3. Calling up a student to a whiteboard to solve an exercise in front
    of the class. Then the class is asked whether the exercise was
    solved correctly, and a discussion ensues. If an answer is known
    there will be no discussion.
 4. Search for older material. Most decent books build skills and
    knowledge step by step, so if you missed a step, you need to flip
    back several sections to find what you are missing. This implicity
    forces you to figure out what exactly you are searching for, an
    important skill by itself.

In most cases the exercises that have no answers be verified by the student himself: plug in the answer and verify that the equation holds true. If an exercise does not have a single best answer, which happens rarely in school math, then the student has to wait for the teacher to check and grade his homework. This waiting adds additional emotional twist, although most students don't care.

> If you don't know how to solve something right away then you need the
> answer to guide you.

No, if you don't know how to solve something, then you need to work with the textbook, flip back several pages and see what has been explained there. Search engines condition students to sloppy thinking, sloppy phrasing, and do not require memorizing anything. Stay away from search engines, use your textbook.