There are many branches of mathematics (analysis, algebra, group theory, logic, ...). Now, I'm interested in relations and their special kinds (like equivalence relation) and their properties. I'd like to find out more about them.

Where should I search to learn everything from the origin of the concept of relation to the knowledge about them of today? Which branch of math studies them carefully?