Let $\lambda$ be an infinite cardinal. Consider the Cantor cube $\Delta_\lambda = \{0,1\}^\lambda$. It is a standard fact in topology that the topological weight (= minimal cardinality for a basis) of $\Delta_\lambda$ is $\lambda$. Let $S$ be a zerodimensional compact space of weight $\lambda$ and suppose $s\colon \Delta_\lambda\to S$ is a continuous suriection. Does there exists a closed subspace $D$ of $\Delta_\lambda$, which is homeomorphic to $S$ such that $p_D$ is a homeomorphism?

$\begingroup$ The dual statement is that if $B$ is a subalgebra of cardinality $\lambda$ of the $\lambda$generated free Boolean algebra, then the inclusion monomorphism splits, and in particular, $B$ is projective. My gut feeling is that this shouldn’t hold in general. $\endgroup$ – Emil Jeřábek Dec 4 '12 at 16:30

$\begingroup$ Are your two functions $s$ and $p$ the same function? $\endgroup$ – Ramiro de la Vega Dec 4 '12 at 18:15
The following construction is due to Pashenkov (see "Extensions of compact spaces", Soviet Math. Dokl., 1974):
Let $X=2^\omega$ and $Z=X \times 2^X$ with product topologies everywhere. Define an equivalence relation on $Z$ by $$(x_1,y_1) \sim (x_2,y_2) \Longleftrightarrow x_1=x_2 \land y_1(x)=y_2(x) \mbox{ for all } x \in X \setminus \{x_1\}.$$
Let $\hat{Z}$ be the quotient space $Z / \sim$ and let $s: Z \to \hat{Z}$ denote the quotient map. Among other things, Pashenkov shows that $\hat{Z}$ is zerodimensional of weight $2^{\aleph_0}$ and that $s$ is an irreducible map (i.e. there is no proper closed subset of $Z$ on which $s$ is still onto $\hat{Z}$).
Thus we get a counterexample to your question by taking $\lambda=2^{\aleph_0}$, $S=\hat{Z}$ and noting that $Z$ is homeomorphic to $2^\lambda$.

$\begingroup$ This is very clever, thank you. By the way, do you think is there any name for the following property (?) of a compact space: $X$ has (?) if for every surjection $s\colon X\to X$ there is a copy $Y$ of $X$ such that $s_Y$ is injective (a homeomorphism onto its image). $\endgroup$ – Bojan Kwitek Dec 5 '12 at 12:15
I think there is an error in the question. For this to be right, $S$ must necessarily have a subspace homeomorphic to $\Delta_\lambda$. That's not true in simple cases like $\lambda = \omega$, $S$ a convergent sequence.

$\begingroup$ Of course, it was a typo. Sorry for this. I want obviously $D$ homeomorphic to $S$. $\endgroup$ – Bojan Kwitek Dec 4 '12 at 15:24