Example of a functor preserving only finite coproducts
What is an example of a functor $$F : \mathsf{Set} \to \mathsf{Set}$$ which preserves finite coproducts, but not infinite coproducts?
The functors preserving infinite coproducts are given by $T \times - : \mathsf{Set} \to \mathsf{Set}$ for some set $T$. If a functor preserves finite coproducts, then the natural map $F(1) \times X \to F(X)$ is an isomorphism if $X$ is finite. Thus, a counterexample will involve infinite sets.
For the category $\mathsf{Ab}$ of abelian groups, a counterexample is simply $X \mapsto X^{\mathbb{N}}$.
Edit.
Jakob Werner has suggested the functor $F(X) = \mathrm{Spec}(A^X)$ for any commutative ring $A$. For fields $A$ this gives the functor of ultrafilters in my answer. I am still curious if there are other, more basic classes of examples.
Solution 1:
The following example seems to work. Consider the composition $$F : \mathsf{Set} \xrightarrow{D} \mathsf{Top} \xrightarrow{\beta} \mathsf{CompHaus} \xrightarrow{U} \mathsf{Set},$$ where $D$ is the discrete topology, $\beta$ is the Stone-Cech-compactification, and $U$ is the forgetful functor. In other words, $F(X)$ is the set of ultrafilters on $X$. Since $D$ and $\beta$ are left adjoint and $U$ preserves finite coproducts, it follows that $F$ preserves finite coproducts. But it does not preserve arbitrary coproducts, since $F(\mathbb{N})$ is not isomorphic to $\coprod_{n \in \mathbb{N}} F(\{n\}) \cong \mathbb{N}$.
Solution 2:
Here is a class of examples, generalizing yours: Look at the composition $$\mathbf{Set}\xrightarrow{\mathfrak{P}}\mathbf{CRing}^{\operatorname{op}}\xrightarrow{\operatorname{Spec}}\mathbf{Set}\,.$$ The first functor takes a set $X$ to the power set ring $\mathfrak{P}(X)\cong\mathbb{F}_2^X$. The interesting thing happens at the second arrow. One can check that the compositions is isomorphic to your functor $F$, as Asaf Karigala points out. But of course you can replace $\mathbb{F}_2$ by any other fixed commutative ring.
Solution 3:
As noted, the ultrafilter functor is an example; in fact, it is the terminal example, as shown by Reinhard Börger in this paper:
http://www.sciencedirect.com/science/article/pii/0022404987900417
All finite-coproduct-preserving endofunctors of $\mathbf{Set}$ are actually quite closely related to ultrafilters. Another basic example is as follows. If $\mathscr U$ is an ultrafilter on a set $A$, we can consider the ultrapower functor $(-)^{\mathscr U} \colon \mathbf{Set} \to \mathbf{Set}$. This sends a set $X$ to the quotient of $X^A$ by the equivalence relation wherein $\vec{x} \equiv \vec{y}$ just when $\{a \in A : x_a = y_a\} \in \mathscr U$ (i.e., when $\vec x = \vec y$ "$\mathscr U$-almost everywhere").
The ultrapower functors preserve finite coproducts (as well as finite limits). In fact, the ultrapower functors are basic in the sense that any finite-coproduct-preserving functor $\mathbf{Set} \to \mathbf{Set}$ is a colimit in $[\mathbf{Set}, \mathbf{Set}]$ of ultrapower functors.
Here is another example, again involving ultrafilters. Let $\mathbb{T}$ be any first-order theory and let $M$ and $N$ be models for $\mathbb{T}$. We can define a finite-coproduct-preserving functor $F_{M,N} \colon \mathbf{Set} \to \mathbf{Set}$ by taking
$$F_{M,N}(X) = \sum_{\mathscr U \in \beta X} \mathbf{Emb}(M^\mathscr{U}, N) $$
where here $\beta X$ is the set of ultrafilters on $X$; $M^{\mathscr U}$ is the ultrapower model of $\mathbb T$ (which is a model by Łoś's theorem); and $\mathbf{Emb}(M^{\mathscr U}, N)$ denotes the set of elementary embeddings of $M^{\mathscr U}$ in $N$.