TITLE: Some basic examples of étale fundamental groups
QUESTION [20 upvotes]: I'm trying to get a better understanding of étale fundamental groups, and I think that the overall idea -- the big picture -- is beginning to become clear, but my computational ability seems to be essentially nonexistent.  
I think that I understand some of the simpler examples (like $\pi(\text{Spec }K)$, when $K$ is a field), but could someone please explain a slightly more complicated (at least in my view) example?  Perhaps (to move away from examples involving fields)  something like $\pi(\text{Spec }\mathbb{Z}[X])$ or $\pi(\text{Spec }\mathbb{Z}[1/p])$?

REPLY [8 votes]: Lenstra's introduction to Galois theory for schemes is very gentle and discusses some basic examples:
Proposition (Corollary 6.17): If $X$ is a normal integral scheme with function field $K$, and $M$ is the composite of all finite separable extensions $L$ of $K$ in some fixed algebraic closure $\overline{K}$ such that $X$ is unramified in $L$, then $\pi_1(X)$ is isomorphic to the Galois group $\mathrm{Gal}(M/K)$.
In particular (Exercise 6.27): If $X$ is a smooth curve with function field $K$, then $\pi_1(X)$ is the quotient $\mathrm{Gal}(K^{sep}/K) / N$, where $N$ is the closed subgroup generated by all inertia subgroups $I_x$ with $x \in X$ closed.
Examples (6.18, 6.22, 6.23, 6.24)

If $K$ is a number field and $A=\mathcal{O}_K$, $a \in A$, $X=\mathrm{Spec}(A[1/a])$, then $M/K$ is the largest Galois extension which is umramified at all non-zero primes not dividing $a$. 
$\pi_1(\mathrm{Spec}(\mathbb{Z}))=\{1\}$ (since Minkowski's Theorem implies that every proper algebraic extension of $\mathbb{Q}$ ramifies at some prime number).
$\pi_1(\mathrm{Spec}(\mathbb{Z}_p)) = \widehat{\mathbb{Z}}$
If $K$ is a field, then $\pi_1(\mathbb{P}^1_K)=\pi_1(\mathrm{Spec}(K))$
If $K$ is a field of characteristic $0$, then $\pi_1(\mathbb{A}^1_K)=\pi_1(\mathrm{Spec}(K))$
If $A$ is a finite ring, then $\pi_1(\mathrm{Spec}(A)) \cong \prod_{\mathfrak{m} \in \mathrm{Spec}(A)} \hat{\mathbb{Z}}$.

Exercises (6.31 $-$ 6.40)

$\pi_1(\mathbb{A}^1_{\mathbb{Z}})$ and $\pi_1(\mathbb{P}^1_{\mathbb{Z}})$ are trivial.
The ring homomorphism $\mathbb{Z}_p \to \mathbb{Z}/p^n$ induces an isomorphism $\pi_1(\mathrm{Spec}(\mathbb{Z}/p^n)) \to \pi_1(\mathrm{Spec}(\mathbb{Z}_p))$.
If $A$ is a complete local ring with residue class field $k$, then $\pi_1(\mathrm{Spec}(A)) \cong \pi_1(\mathrm{Spec}(k))$.
$\pi_1(\mathrm{Spec}(\mathbb{Z}[i]))$ and $\pi_1(\mathrm{Spec}(\mathbb{Z}[(1 + \sqrt{-3})/2]))$ are trivial.
$\pi_1(\mathrm{Spec}(\mathbb{Z}[\zeta_{20}]))$ and $\pi_1(\mathrm{Spec}(\mathbb{Z}[(1 + \sqrt{-163})/2]))$ are trivial.
$\pi_1(\mathrm{Spec}(\mathbb{Z}[\sqrt{-5}]))$ has order two.
$\pi_1(\mathrm{Spec}(\mathbb{Z} \times_{\mathbb{Z}/(6)} \mathbb{Z})) \cong \widehat{\mathbb{Z}}$
$\pi_1(\mathrm{Spec}(\mathbb{Z}[x]/(x^6-1))) \cong \widehat{\mathbb{Z}}$
$\pi_1(\mathrm{Spec}(\mathbb{Z}[\sqrt{-3}]))$ has order two.

Let me finish with the following remark: Every profinite group arises as the fundamental group of some connected scheme. See here.