How to prove hom functor preserves pullbacks I saw some answers in Hom-functor preserves pullbacks but the replies are too short, could someone please give me a more detailed solution to this?
 A: Following Martin's answer from the link, we want to show that the natural map 
$$Hom(A,X\times_{S}Y)\to Hom(A,X)\times_{Hom(A,S)}Hom(A,Y)$$
is a bijection. Now in the category of sets, the pullback of two maps $f:X\to S$ and $g:Y\to S$ can be identified with $\{(x,y)\in X\times Y: f(x)=g(y)\}$. For the above example, using the definition of the $Hom$ functor along with this fact, we can identify the RHS pullback as the set of commuting squares
$$\begin{array}{ccc}
A & \to & Y
\\
\downarrow & & \downarrow
\\
X & \to & S
\end{array}$$
By universal property of pullback, there is a unique morphism $\eta:A\to X\times_{S} Y$ making the pullback diagram commute (I don't want to draw the picture) which depends only on the above commuting square. The uniqueness condition provides us with a well defined function from commuting squares to morphisms $A\to X\times _{s} Y$. Hence a backwards map
$$Hom(A,X)\times_{Hom(A,S)}Hom(A,Y)\to Hom(A, X\times_{S} Y).$$
Now one needs to check that the composite of this map with the above gives identity. However, this follows immediately from the universal property of pullback.
