Is the map $f^*: \mathrm{Spec}(S) \to \mathrm{Spec}(R)$ injective or surjective where $f: R \to S$ is a ring homomorphism. Is the map $f^*:\mathrm{Spec}(S) \to \mathrm{Spec}(R)$ injective or surjective where $f: R \to S$ is a ring homomorphism.


I know that if $P$ is a prime ideal in $S$, then $f^{-1}(P)$ is a prime ideal in $R$.

I think it is injective but cannot show why.
Take $$k\to k[x]$$ then $\rm{spec} \ k$ has one element, so it cannot be injective.
This from a book Algebraic geometry and arithmetic curves, Qing Liu, p.28.


  Lemma: Let $\varphi:A\to B$ be a ring homomorphism and $spec(\varphi):spec(B)\to spec(A)$ then if $\varphi$ is surjective then $spec(\varphi)$ induces a isomomorphism from $spec(B) $ onto the closed subset $V(ker \varphi)$ of $spec(A).$


EX: Let $A$ be a ring then the quotient homomorphism $\varphi:A\to A/I$ induces a homomorphism $spec(\varphi):spec(A/I)\to spec(A)$ and $ spec(A/I)\cong V(I)\subseteq spec(A)  $ where $V(I):=\{p\in spec(A); I\subseteq p  \}$