I recently had a bunch of questions on a problem set that I could not solve and the instructor is not providing solutions.
Let $f: A \to B$ be a surjective ring homomorphism. Prove that the induced map $g: \operatorname{Spec} B \to \operatorname{Spec} A$ is injective.
I tried using the definition of injectivity but I don't know where to go from there and how to use the surjectivity of $f$. Can someone give me a detailed explanation?
This is a community wiki post recording the answer from the comments so that this post may be marked as answered.