I am studying groups from I.N Herstein and he talks about the notion of homomorphism in the following way:
By this (homomorphism) one means a mapping from one algebraic system to a like algebraic system which preserves structure. We make this precise, for groups, in the next definition.
Definition: A mapping from group G into a group G' is a homomorphism if for all a,b $\in$ G, $\phi(ab)=\phi(a)\phi(b)$
There are two things I note here:
He says "for groups etc etc" which I think implies that the above definition of a homomorphism is only valid for some (like groups) and not all structures while on the other hand the definition of homomorphism being a mapping that preserves structure is one which is general. Is this inference correct?
The above brings me to my follow-up question - What exactly does it mean to preserve the structure and how for groups the above definition encodes that?
When I think of "a mapping that preserves structure" something like the following comes to mind:
A mapping that takes the set of equally spaced points on the X-axis to the equally spaced points on the Y-Axis.
or
A mapping that takes a set of points forming a figure (let's say a rectangle) on a plane to a set of points that form a rectangle at a different position on the plane.
As one can see my notion of a mapping that preserves structure is a very limited one. How do I understand it in the context of groups, the above definition and in a more general way so that if I read a book talking about homomorphism of some other structure besides groups I would know how it preserves structure.