In the Kechris book on (Classical) Descriptive Set Theory there is a claim that a separable metrisable space is zero dimensional if and only if every closed set is a cts retract of the whole space (Theorem 7.3).

Zero dimensional is equivalent to: there is a basis of clopen sets.

One direction ($\Rightarrow$) is easy: one can easily place the space into an homeomorphism with a subset of cantor space. I would like to know how to prove the other direction. The reference in Kechris is to Kuratowski: but I looked at this old topology handbook and it only contained the ($\Rightarrow$) direction (in fact it did not even claim the reverse direction).

Is Kechris’ claim correct? If so, and you know the proof or a sketch thereof, it would be great if you could post it.

I tried setting up a contradiction; let $x\in U$ with $U$ open so that there is no clopen $A$ with $x\in A\subseteq U$. Then letting $x\in V_{n}\subseteq U$ be a neighbourhood basis for $x$ with $(V_{n})_{n}$ monotone decreasing, I took the inverse limit of a sequence of (compatible) retracts:

$X\setminus V_{0}\twoheadleftarrow X\setminus V_{1}\twoheadleftarrow\ldots \breve{X}$

where for each $n$, there is no clopen set $A$, such that $X\setminus V_{n}\subseteq A\not\ni x$. But didn't get far with this$\ldots$