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 zero-dimensional 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?



Quotients of Cantor cubes onto spaces 
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 zero-dimensional 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$.


