Let $X$ and $Y$ be finitely presented schemes over $\mathbb{C}$. Let $f\colon X\to Y$ be a proper morphism. Let us assume that for any finitely presented scheme $S$ the induced map $$Mor_{Sch}(S,X)\to Mor_{Sch}(S,Y)$$ is injective.
Question. Is it true that $f$ is a closed imbedding?
The simplest case which I do not understand is the case of $X$ and $Y$ being spectrums of local Artinian rings.
I am also interested in the analogous situation when finitely presented schemes over $\mathbb{C}$ are replaced by complex analytic spaces.