Classifying automorphisms using a group presentation.
I'm new to group presentations and after some playing around with the concept, I've tried to find some relatively clear criteria in terms of the defining relations, that would tell us if a map is an automorphism. I would appreciate any input - whether my approach is correct, and whether there's some other more general or neater way.
Let $X=\{x_1,\dots ,x_n \}$ be a finite set and let $R$ be some finite set of relations on the alphabet of $X \cup X^{-1}$. Denote $G$ the group corresponding to these defining relations - $G= \langle X \mid R \rangle =F_X / N$, and presume $G$ is finite.
I think the following might be true:
Consider a map $f:X \rightarrow G$. If $\langle f(x_1),\dots ,f(x_n) \rangle = G$ and $f(x_i)$ satisfy the corresponding relations when stated in terms of $x_i$, then $f$ induces an automorphism.
Proof: If we show that $f$ induces homomorphism $\overline{f}$, it's surjective and hence an automorphism, so we only need to show that $f$ actually induces a homomorphism.
Consider the free group $F$ on $X$, and define $g:F \rightarrow G$ by $w \mapsto f(w_1)f(w_2)\dots f(w_m)$. We know that $f(x_i)$ satisfy the wanted relations, and so the $N \subseteq \ker (g)$. By the homomorphism theorem there exists a $\psi$, such that $\psi \circ \pi_N = g$. This $\psi$ is the wanted extension of $f$.
In some sense this seems excessive - we're dealing with finite groups. An idea of how to deal with this in finite groups:
Presume that any element in $G$ can be expressed as a word in $X$ of length at most $k$. Define a map $g$ from words of length $2k$ to $G$ induced by $f$. If we check that for any two words of length $2k$ that represent the same element in $G$, that their image is the same, we will be done.
I know that none of this is very formal, but I would mostly like to know whether my approach is sensible. I would also appreciate if someone linked some text that deals with this in a more formal way.
This question was dealt with in the comments by j.p. . I am summarising here so that it does not remain listed as unanswered.
By the assumption on $f$, we know that $\bar{f}$ will be surjective, and as we are mapping between finite groups, it must also be bijective. As the $f(x_{i})$ satisfy the given relations, the extension to the map $\bar{f}$ is a homomorphism.