Restriction of automorphism to subgroup not implies automorphism

From Groupprops

Statement

We can have a group , a subgroup , and an automorphism of such that , but is not equal to . In other words, restricts to an endomorphism of (which is necessarily an injective endomorphism), but the restriction is not an automorphism of .

Related facts

Proof

Example of the integers and the rationals

Let be the group , i.e., the additive group of rational numbers. Let be the subgroup , i.e., the additive group of integers. Consider the automorphism of given by , i.e., it sends every rational number to its double.

is clearly an automorphism of , and sends to within itself: the restriction of to is the map that sends every integer to its double. The restriction of to is not an automorphism of : the image is the proper subgroup comprising even integers.