How does a permutation of roots induce an automorphism on a splitting field? I'll be learning Galois theory for the first time later this year and wanted to clear up something that was puzzling me.  
If f(x) = $\sum {a_ix^{i}}$ is a polynomial which is irreducible over $\mathbb{Q}$ and K is the splitting field of f (so it is the intersection of all fields which contain $\mathbb{Q}$ and all the roots of f), it is easy to see that any automorphism $\phi$ of K which fixes elements of $\mathbb{Q}$ will permute the roots of f.  This is because if $r$ is a root of f, then $0$ = $\sum {a_ir^{i}}$ $\Rightarrow$ $0$ = $\phi (0)$ = $\phi(\sum {a_ir^{i}})$ = $\sum {a_i\phi(r)^{i}}$, whence $\phi(r)$ is also a root of f.
My question is: how does the other direction work?  How does a permutation of the roots $r_1, r_2 $ etc. of f induce an automorphism on K (which fixes elements of $\mathbb{Q}$)?  The impression I have gotten from reading guides online is that there is a very obvious, natural way to build an automorphism from a permutation of roots, but it does not appear to me to be at all obvious.
EDIT: okay, so there is no guarantee that there exists an automorphism which permutes the roots in a predetermined manner.  But how do you know that two different automorphisms cannot permute the roots in the same way?  In other words if there is an automorphism $\phi$ which DOES give some permutation $\sigma$ on the roots, how can I use the roots alone to uniquely determine $\phi$?
 A: Others will probably give more complete answers, but it is not the case that every permutation induces an element of the Galois group. Example: $X^4+1$ as your irreducible polynomial, over $\mathbb{Q}$. Its roots are the primitive eighth roots of unity, $(\pm1\pm i)/\sqrt2$. The splitting field is the field generated by one of them, call it $\zeta$. You can send $\zeta$ to any of the other roots, $\zeta^3$, $\zeta^5$, or $\zeta^7$, but once you have settled on which one, the images of the others under your automorphism are determined.
So, the way you should think of things is that one root of your irreducible polynomial may be sent to any other root, and I think you see how to do this, but after that, things get dicier, because you need to look more closely to see what further restrictions there may be on where some other root goes.
A: Your question is  very profound and it is at the heart of  Galois theory.
It took Galois' genius to realize that given a polynomial $f(x)$ and its roots, not all permutations of them are equally useful : only the ones  corresponding  to what we now call the Galois group of the splitting field of $f(x)$ are  relevant.
In other words, the answer to your question consists of all of Galois theory!
 Lubin, for example,  gave you in his answer a glimpse  of what that theory has to say if you are interested in the so-called cyclotomic polynomials.
One must realize that Galois never studied automorphisms of fields (a concept unknown in his time), but only permutations  of roots.
The development of the modern Galois theory necessitated about a century of developments, culminating in Emil Artin's point of view in the 1940's, which is essentially what has been taught since and that you will soon have the pleasure  to savour .
Jean-Pierre Tignol (a remarkable algebraist) wrote a pleasant and erudite book, harmoniously blending  history and mathematics, on  the historical development of Galois theory (starting several centuries before his birth...)
Edit
As to your edited question, it is very simple if you know how the permutation $\sigma$ acts on the roots of your polynomial to determine the automorphism $\phi$:
Since every element of $K$ can be written as $a=f(\alpha_1,...,\alpha_n)$ (see the comments to your question), just use the formula $$\phi(a)=\phi(f(\alpha_1,...,\alpha_n))=f(\alpha_{\sigma (1)},...,\alpha_{\sigma (n)})$$
A: @Frogeyedpeas Well, unfortunately generating sets are not canonical, so there's no canonical correspondence for generating sets.  If you work with generating sets, each case is its own thing.
If $f = (X - r_1) \cdots (X - r_n) \in \mathbb{Q}[X]$ (assume $r_1, ... , r_n$ are distinct, but we need not assume $f$ is irreducible) and $K = \mathbb{Q}(r_1, ... , r_n)$, there is a canonical group monomorphism from $Aut(K/\mathbb{Q})$ (the group of field isomorphisms of $K$ onto itself) into the symmetric group on $r_1, ... , r_n$, where you send $\phi$ to the permutation which sends $r_i$ to $\phi(r_i)$.  As others have pointed out, this map need not be surjective.  
If $S_n$ is the symmetric group on $r_1, ... , r_n$, let $\Phi: Aut(K/\mathbb{Q}) \rightarrow S_n$ be the group monomorphism I just mentioned.  If $H$ is the image of $\Phi$, then the inverse mapping $\Psi: H \rightarrow Aut(K/\mathbb{Q})$ is the following: every element of $K$ can be expressed as $g(r_1, .. , r_n)$, where $g$ is a polynomial with rational coefficients.  If $\sigma \in H$, one then defines $\Psi(\sigma) \in Aut(K/\mathbb{Q})$ by the formula $$\Psi(\sigma)(g(r_1, ... , r_n))= g(r_{\sigma(1)}, ... , r_{\sigma(n)})$$  For $\sigma \in S_n$, this function is well defined if and only if $\sigma$ is actually in the image of $\Phi$.  I'm not sure if that answers your question.  Feel free to ask me anything about this stuff you're confused on.  
When you learn Galois theory, you'll prove that $|Aut(K/\mathbb{Q})| \leq [K : \mathbb{Q}]$.  However, the following are equivalent:
(i) $f$ is irreducible.
(ii) The image of $\Phi$ is a transitive subgroup of $S_n$.
(iii) $|Aut(K/\mathbb{Q})| = [K : \mathbb{Q}]$.
(iv) If $y \in K$, but not in $\mathbb{Q}$, then there exists a $\phi \in Aut(K/\mathbb{Q})$ such that $\phi(y) \neq y$.
If any of those conditions hold, the extension $K/\mathbb{Q}$ is called a "Galois extension," and the group $Aut(K/\mathbb{Q})$ is now referred to as the Galois group of $K/\mathbb{Q}$, and we refer to it as $Gal(K/\mathbb{Q})$.
