How do you find the automorphism? How exactly would you find all the automorphism of something like $Z_8$ or $U(8)$?

I read that there are $4$ automorphisms of $Z_8$, but how did they come about it?
Please explain this as if talking to a beginner. Thanks
 A: In the case of $\Bbb Z/8\Bbb Z$, a homomorphism is determined by where it sends a generator, and an automorphism must send generators to generators. What are the generators? Work from there.
In the case of $U(8)=(\Bbb Z/8\Bbb Z)^\times$, automorphisms permute elements of the same order, and this groups has three elements of order three. Find out which permutations are possible.
A: every automorphism $\phi$ of a cyclic group generated by a
is completely determined by $\phi(a)$; as a consequence the number of automorphisms of a cyclic group $G$ equals the number of its generators.
Also note that  $\operatorname{Aut}(\Bbb{Z}_n) ≈ U(n)≈ \Bbb{Z}_n^×$
A: This entry is full of hints...maybe a fuller answer would be useful?
$U(8)$ has the operation of multiplication modulo 8.  $1$ is the identity.  To be a group, each element must have an inverse.  If we imagine starting with the set of numbers $0,1,2,3,4,5,6,7$,  then we see that $0, 2, 4$, and $6$ do not have inverses: you cannot multiply them by anything in the set which will give an answer of $1 \bmod 8$.  So we are left with $3,5,7$.  Each is its own inverse.  (So each is cyclic with order two - meaning, you multiply it by itself two times and get back to the identity.)  For example, $3*3=9\equiv 1 \bmod 8$.
So the elements of the group $U(8)$ are $1,3,5,7$.  It is of order four, meaning it has four elements.
To be an automorphism it must also be an isomorphism.  That means:
$$\phi(a * b) = \phi(a) * \phi(b)$$
that is, if we take two elements a and b, we can perform the group operation before mapping or after mapping and get the same result.
For example, if our automorphism map is the $3\to 3,5\to 7$ and $7\to 5$ then, for example we can perform the operation $3*5$ in the original group and get the result $7$, which maps to $5$ in the automorphic group.
Or, we can map $3\to 3$ and $5\to 7$, and perform the operation in the automorphic group, i.e. $3*7$, with the result being $21 \bmod 8 = 5$. We show that this works for all cases, which shows that it is an automorphism.
For the case of $\mathbb{Z}/8\mathbb{Z}$, the set is $\{0,1,2,3,4,5,6,7\}$ and the group operation $\bmod 8$ addition.  $1,3,5$ and $7$ are generators, meaning that I can take any one of them, add it to itself a number of times, and get the whole group.  For the isomorphism formula above to work, this must also be true in the automorphic group.  Because $1$ is a generator, once I map it to a different generator, I determine the rest of the automorphism.  For example, if I map $1\to 3$, then since $1+1=2$ (original group), and $3+3=6$ (mapped group), I must map $2\to 6$.  $1+1+1=3$ (original group), $3+3+3=9\equiv 1 \bmod 8$ (mapped group), so I must map $3\to 1$, etc..  So I really have only four choices, $1\to1, 1\to3,1\to 5,1\to 7$, and any one of these gives an automorphism.
