I understand this question seems to be off-topic and basic to you. But I want to learn about mathematics, I understand that it depends on many factors, but what I really wanted was the recommendation of some books that could help me — a computer science student. Maybe books like logic, statistics, sets, or any other field you think is important.
That's the point of the question. However, if you can recommend me a book like "how to solve problems", I would appreciate it, because I don't just want to learn math as a device to become a better programmer, I want to learn about this discipline that, for me, is interesting.
If you know basic algebra, geometry and trigonometry as taught in schools typically up to age 16, then you could read "Pure Mathematics 1" by Backhouse or "Extending Mathematics 1" by Heard. These books correspond to what used to be called "Additional Mathematics" at Ordinary Level in England. They cover harder algebra, trigonometry and analytic geometry, as well as introducing calculus.