We are in a category where everything that follows exists.
Is the fibred product $A \times_B (B \times_C D)$ isomorphic to $A \times_C D$ or to $A \times_C (A \times_B D)$?
We are in a category where everything that follows exists.
Is the fibred product $A \times_B (B \times_C D)$ isomorphic to $A \times_C D$ or to $A \times_C (A \times_B D)$?
On
Amitai already answered you in full, but another way to say it is that $B\times_C D$ is the object representing the functor
$T \mapsto Hom(T,B) \times_{Hom(T,C)} Hom(T,D),$
from the category $\mathcal{C}$ to the category $(Sets)$, where the fibre product on the right hand side is taken in the category of sets.
The functor that the product $A \times_B \times(B \times_C D)$ represents is
$T \mapsto Hom(T,A)\times_{Hom(T,B)} Hom(T, B \times_C D) \\= Hom(T,A) \times_{Hom(T,B)} (Hom(T,B) \times_{Hom(T,C)} \times Hom(T,D)).$
To show the objects are isomorphic it's enough to show the functors they represent are isomorphic. To do that you have to show the fibre product of sets in the right hands above are canonically in bijection.
This shows it's enough to assume the category is $(Sets)$.
Now suppose $A,B,C,D$ are sets and there are functions $\alpha: A \rightarrow B$, $\beta: B \rightarrow C$, $\delta: D\rightarrow C$. Then $$B\times_C D = \{(b,d)\in B\times D : \beta(b)=\delta(d)\},$$ with the function $\phi: B\times_C D \rightarrow C$ given by $\phi(b,d)=\beta(b)=\delta(d)$, and the projection $\pi: B\times_C D \rightarrow B$ given by $\pi(b,d)=b$.
Then $A \times_B (B \times_C D) = \{ (a,(b,d)): \alpha(a)=\pi(b,d)=b\}.$
Then $(a,(b,d)) \mapsto (a,d)$ is a bijection between $A\times_B (B\times_C D)$ and $(A\times_C D)$ with the inverse given by $(a,d) \mapsto (a,(\alpha(a),d))$.
On
This is (part of) the pasting lemma for pullbacks. If in the following diagram the two squares are pullbacks, so is the outer rectangle:
$$ \require{AMScd} \begin{CD} X @>>> Y @>>> D \\ @VVV @VVV @VVV \\ A @>>> B @>>> C \end{CD} $$
So $X \cong A \times_C D$, but also $X \cong A \times_B Y \cong A \times_B (B \times_C D)$.
A morphism into $A\times_B(B\times_CD)$ is equivalent to a morphism into $A$ and a morphism into $B\times_CD$ such that the corresponding diagram commutes. But a morphism into $B\times_CD$, in turn, is equivalent to a morphism into $B$ and a morphism into $D$ which make another diagram commute. So all in all a morphism into $A\times_B(B\times_CD)$ is equivalent to three morphisms - into $A,B,D$ - that fit into a commutative diagram. Note that since there is a given morphism $A\to B$, once we have a morphism into $A$ we automatically get a morphism into $B$ by composition. Thus the three above morphisms are equivalent to a pair of morphisms - into $A,D$ - that commute over $C$.
In conclusion, $A\times_B(B\times_CD)\cong A\times_CD.$