Exercise 1.3 D of Vakil's lecture notes on algebraic geometry asks:
"Verify that $A \to S^{−1}A$ satisfies the following universal property:
$S^{−1}A$ is initial among $A$-algebras $B$ where every element of $S$ is sent to an invertible element in $B$. (Recall: the data of “an $A$-algebra $B$” and “a ring map $A \to B$” are the same.)
Translation: any map $A \to B$ where every element of $S$ is sent to an invertible element must factor uniquely through $A \to S^{−1}A.$"
My question:
I can prove the translation, but I don't entirely understand the first statement. What are the morphisms in the category of $A$-algebras? Clearly, given the ring map $A\to B_1$, a ring map $B_1 \to B_2$ induces via composition a morphism of $A$-algebras taking the algebra $A\to B_1$ to the algebra $A \to B_2.$ But is it clear that ALL morphisms are of that form?
A map of $A$-algebras in this language is a commutative triangle (which I will draw as a square because it's easier).
$$\begin{array}{ccc}B_1&\to&B_2\\\uparrow&&\uparrow\\A&=&A\end{array}$$
What you are pointing out is that if $B_1$ is an $A$-algebra and $B_2$ is a ring, then any ring map $B_1\to B_2$ can be used to make $B_2$ into an $A$-algebra by composition. But this is not the situation that you are in - you have two $A$-algebras $B_1$ and $B_2$, so they are both rings with fixed ring maps from $A$. So a morphism $B_1\to B_2$ of $A$-algebras is a ring map $B_1\to B_2$ that commutes with the two fixed structure maps from $A$ as in the above (square-looking) triangle.