Morphisms to categorical product completely determined by composition with canonical projections? Consider the diagram:
$$\begin{array}{} &&&& A_1 \\ &&& \overset{\pi_1}\nearrow \\ X & \overset f{\underset g \rightrightarrows} & A_1 \times A_2 \\ &&& \underset{\pi_2}\searrow \\ &&&& A_2 \end{array}$$
where $X$ is any arbitrary object, $(A_1 \times A_2, \pi_1, \pi_2)$ is the category product of $A_1$ and $A_2$, and $f$ and $g$ are any maps from $X$ to $A_1 \times A_2$.
My question is whether $\pi_1 \circ f = \pi_1 \circ g$ and $\pi_2 \circ f = \pi_2 \circ g$ imply $f=g$, i.e. whether a morphism from any object to a categorical product is uniquely determined by the composition with the two projection morphisms.

Yes, this is exactly the content of the universal property of the categorical product. 


*

*For every pair of maps $f_1,f_2\colon X\to A_1,A_2$ there is a map $f\colon X\to A_1\times A_2$ satisfying $\pi_1\circ f=f_1$ and $\pi_2\circ f=f_2$

*If there are two maps $f,g\colon X\to A_1\times A_2$ satisfying $\pi_1\circ f=f_1$ and $\pi_2\circ f=f_2,$ then they are equal.
Together, the two statements say "for any pair, there is one and only one arrow to the product." So yes, $f_1$ and $f_2$ determine $f$ by statement 1, and do so uniquely (any two such arrows are equal) by statement 2.
