Let $X, Y$ be Polish spaces and $f : Y \to X$ be a Borel function, i.e. preimage of every Borel subset of $X$ be a Borel subset of $Y$. Prove that $f[Y]$ is an analytic subset of $X$.
Note: If $f$ were continous, the above would be a precise definition of an analytic subset.
I can vaguely recall a proof I've seen based on refining the topology so that some Borel sets become clopens but no additional sets become Borel; I don't remember what it was exactly. A proof in that fashion is preferred, but any other proof or hint will also be greatly appreciated.
The graph of $f$ is a Borel subset of $Y \times X$, which is a Polish space.
A Borel subset of a Polish space is analytic.
Projection is continuous.
The continuous image of an analytic set is analytic.