What can we say about closed sets in the Baire space that are neither open nor compact? I'm trying to figure out what closed subsets in $\omega^{\omega}$ equipped with product topology should look like. It seems to me it's relatively easy to have an idea about compact closed subsets and clopen subsets. But there're still other closed subsets that don't fall into the above two categories, say the set of all permutations of $\omega$. Is there some way to charaterize  closed sets in the Baire space that are neither open nor compact?  
 A: First, a small correction: The set of permutations of $\omega$ is not closed in Baire space.  Let $f_n$ be the permutation that sends $k$ to $k+1$ for $k=0,1,\dots, n-1$, sends $n$ to $0$, and fixes all numbers $k>n$. Then the sequence $(f_n)_{n\in\omega}$ converges in Baire space to the successor function, which is of course not a permutation.
Now for your question: Define (for the purposes of this answer) a tree to be a set $T$ of finite sequences of natural numbers such that, whenever a sequence $s$ is in $T$, so are all its initial segments.  You should visualize the biggest tree, the set of all finite sequences of natural numbers, as the name "tree" suggests: The empty sequence is its root, the one-term sequences are the immediate successors of the root, the immediate successors of $\langle a\rangle $ are the sequences $\langle a, b\rangle $ for all $b$, etc.  Other trees $T$ are subtrees of tis biggest one.  A path through a tree  $T$ is an infinite sequence $x$ of natural numbers (i.e., a point in Baire space) all of whose finite initial segments are in $T$.  The set of all paths through $T$ is usually denoted by $[T]$.  It is a closed subset of Baire space, and every closed subset has this form for some tree.  This is how I generally visualize closed sets; I visualize the tree, which is relatively easy to visualize, since it consists of finite sequences.
Different trees can have the same set of paths, but only for a rather silly reason: If a tree $T$ has a leaf, i.e., a member $s$ with no proper successors in $T$, then no path through $T$ can go through such an $s$, so you might as well remove all leaves from $T$. That won't affect $[T]$ at all.  But, after this pruning, the remaining tree might again have leaves --- elements $s$ that had proper successors in $T$ but all those successors were leaves and are therefore no longer present.  So you can prune a second time, and a third, etc.  In fact, the process can be continued transfinitely, but after some countable ordinal number of prunings, you will obtain a leafless tree with the same paths as the original.  This tree is unique, i.e., it is completely determined by the closed set $[T]$.  (In fact, it consists of those finite sequences that are initial segments of some $x\in[T]$.) So there is a one-to-one correspondence between closed subsets of Baire space and leafless trees.  
To make contact with the special sorts of closed sets mentioned in your question: For a leafless tree $T$, we have that (1) $[T]$ is compact iff each element of $T$ has only finitely many immediate successors (i.e., $T$ is a finitely branching tree), and (2) $[T]$ is clopen iff every path through $T$ has an initial segment $s$ such that all finite sequences that extend $s$ are in $T$.
