Induced ring homomorphism by map on spectra

I know that when we have a ring homomorphism $$\phi: A\rightarrow B$$ this induces continuous map between the spectra $$\phi': \operatorname{Spec} B\rightarrow \operatorname{Spec}A$$ which maps $p$ to $\phi^{-1}(p)$. What I am wondering about is the other direction. Suppose we have a map between the spectra, is it possible to determine (explicitly) the induced map on the ring? Is it absolutely necessary to consider a morphism affine schemes to do this?

My particular question concerns showing that $A$ is finitely generated as a $\mathbb C$-algebra, i.e. there exists a surjective morphism of rings $\mathbb C[x_1,..., x_n]\rightarrow A$, knowing that $A\otimes_{\mathbb C} B$ is finitely generated (i.e. there exists a surjective morphism of rings $\mathbb C[x_1,..., x_n]\rightarrow A\otimes_{\mathbb C} B$) using the fact that $\operatorname{Spec}(A\otimes_\mathbb C B)=\operatorname{Spec} A\times \operatorname{Spec} B$. Or is this equality only true in the reduced and finitely generated case to begin with?

• Spec is neither faithful nor full, so given a continuous map on spectra, a map on rings inducing it will neither exist nor be unique in general. The "equality" you claim is false; the underlying topological space of the product of two varieties does not have the product topology. (All told, Spec is a very poorly behaved functor.) – Qiaochu Yuan Jan 21 '16 at 0:40
• Anytime $Y$ is an affine scheme we have a bijective correspondance between $\operatorname{Hom}(X,Y)$ and $\operatorname{Hom}(\mathcal{O}(Y), \mathcal{O}(X))$, where we consider morphsms of locally ringed spaces rather than just continuous maps. – basket Jan 21 '16 at 0:52
• An example: you can define a homomorphism $k[x] \to k[y]/(y^2)$ either by sending $x$ to $y$ or $0$. The corresponding continuous maps on spectra can't tell the difference. – Hoot Jan 21 '16 at 2:05

I prefer summerize and improve the answers of Qiaochu Yuan and basket!

Let $A$ and $B$ be rings, $X=\operatorname{Spec}A$ and $Y=\operatorname{Spec}B$; one can prove that the function $$\Phi:(f,f^{\sharp})\in\operatorname{Hom}_{\bf LocRingSp}((X,\mathcal{O}_X),(Y,\mathcal{O}_Y))\to f^{\sharp}(Y)\in\operatorname{Hom}_{\bf Ring}(B,A)$$ is bijective; moreover, the morphism $(f,f^{\sharp})$ is uniquely determined by $f^{\sharp}(Y)$.

What I mean? Which is the improvement?

As you (user306194) affirm: given a morphism of rings (that is $f^{\sharp}(Y)$ in my notation) you can construct a unique morphism of locally ringed spaces $(f,f^{\sharp})$; but, given a continuous map $f$ between the support of locally ringed spaces, you can't define uniquely $f^{\sharp}$!

For example: you read the previous comment of Hoot.

Obviously, all this works in the setting of schemes.

In general, let $A$ be a ring and let $Y$ be a scheme, $X=\operatorname{Spec}A$; one can prove that the function $$\Phi:(f,f^{\sharp})\in\operatorname{Hom}_{\bf Sch}(Y,X)\to f^{\sharp}(X)\in\operatorname{Hom}_{\bf Ring}(A,\mathcal{O}_Y(Y))$$ is bijective.

Moreover in general: let $S$ be a scheme, let $X$ be an $S$-scheme with structure morphism $p$ and let $\mathcal{A}$ be a quasi-coherent $\mathcal{O}_S$-algebra; one can prove that the function $$\Phi:(f,f^{\sharp})\in\operatorname{Hom}_{S-\bf Sch}(X,\operatorname{Spec}\mathcal{A})\to f^{\sharp}(\operatorname{Spec}\mathcal{A})\in\operatorname{Hom}_{\mathcal{O}_S-\bf Alg}(\mathcal{A},p_{*}\mathcal{O}_X)$$ is bijective; where $\operatorname{Spec}\mathcal{A}$ is the relative spectrum of $\mathcal{A}$.

For a reference, I council Bosch - Commutative Algebra and Algebraic geometry, Springer, sections 6.6 and 7.1.

In conclusion, I remember you that $\operatorname{Spec}(A\otimes_{\mathbb{C}}B)$ is canonically isomorphic to $\operatorname{Spec}A\times_{\operatorname{Spec}\mathbb{C}}\operatorname{Spec}B$; usually, the Cartesian product of sets is very bad in the category of schemes.

From the same book, I council you the section 7.2 with any examples and exercises 3, 4 and 5.