I'm a novice at category theory but I think the following referring to the direct product of vector spaces would generalize to the categorical product, if correct - on which is I would appreciate feedback: errors, or correctness and references.
The proofs I can find on the associativity of the direct product seem to focus on $(A \times B) \times C = A \times (B \times C)$. This clearly extends to any finite combination. Since the direct product is defined for a (possibly uncountable) collection of spaces $\{V_\alpha\}$ I want to try my hand at a more general proof.
I rely on the definition by the universal mapping property and the established result that two direct products on the same set of spaces are isomorphic ....
- A direct product $\Pi_{\alpha \in A} V_\alpha$ of a (possibly uncountable) set of vector spaces $\{V_\alpha\}_{\alpha \in A}$ over $F$ consists of a vector space $V$ and a system of linear surjective maps (canonical projections) $p_\alpha : V → V_\alpha$ with the following universal mapping property: whenever $U$ is a vector space and $\{L_\alpha\}_{\alpha \in A}$ is a system of linear maps $L_\alpha : U \to V_\alpha$, then there exists a unique linear map $L : U \to V$ such that $L_\alpha = p_\alpha L$ for all $\alpha$.
- the direct product is unique up to isomorphism. I.e. if $\{V, p _{\alpha \in A}\}$ and $\{V`, p` _{\alpha \in A}\}$ are two direct products for $\{V_\alpha\}_{\alpha \in A}$ then there exists a unique isomorphism $φ: V` → V$ with $p`_\alpha = p_\alpha φ$ for all $\alpha$.
With the items defined as above, take $B, C$ as disjoint subsets of $A$ with $A = B \cup C$
I want to show that $\Pi_{\alpha \in A} V_\alpha \cong \Pi (\Pi_{\beta \in B}, V_\beta, \Pi_{\gamma \in C}, V_\gamma)$.
This would then include the case $(A \times B) \times C = A \times B \times C = A \times (B \times C)$
Consider the direct product and the corresponding maps in two parts $\{V_\beta\}, \{V_\gamma\}, \{L_\beta\}, \{L_\gamma\},\{p_\beta\},\{p_\gamma\}$ as in the top part of the diagram.
Then form the direct products $\{V_B, p _{b \in B}\}$, $\{V_C, p _{c \in C}\}$ with their corresponding maps $L_B: U \to V_B$ and $L_C: U \to V_C$. The unique maps $L_B, L_C$ exist by the universal property.
Lastly form the direct product of $V_B, V_C$, as $\{V`, \{p`_B, p`_C\}\}$ and $L`$ exists by the universal property.
Then the maps can be composed
$L_\beta = p_\beta L = p_b L_B$ and $L_B = p`_B L`$ so that $L_\beta = p_b p`_B L`$
$p_b, p`_B $ are surjections and then so is their composition.
The same applies to the "C" side of the diagram.
Then take $\{p`_\alpha\} = \{p_b p`_B\} \cup \{p_c p`_C\}$ so that $\{V`, \{p`_\alpha\}\}$ is a direct product for $\{V_\alpha\}$.
By uniqueness it is isomorphic to $\{V, \{p_\alpha\}\}$.
I.e. $\Pi_{\alpha \in A} V_\alpha \cong \Pi (\Pi_{\beta \in B} V_\beta, \Pi_{\gamma \in C} V_\gamma)$.

(FYI, § 3.8 in Topoi: The Categorial Analysis of Logic, by Robert Goldblatt, briefly discusses product associativity, but the relevant proofs are sparse, and some are done by you.)
It's worth noting up front that the categorical product often isn't going to be a direct product, even when the objects are sets and their morphisms are functions. In particular, if the category doesn't include the direct product you're looking for but the morphisms in the category can't tell the difference, then the "product" could be quite unexpected.
For example, define $\mathcal{C}$ as follows:
Objects $a:=\{v\}$, $b:=\{w,x\}$, $c:=\{y,z\}$.
Morphisms $f:a\rightarrow b$ s.t. $f(v)=w$, and $g:a\rightarrow c$ s.t. $g(v)=z$.
In this case, the limit of $\{b,c\}$, i.e., $b\times c$, exists and is $a$ because, well, nothing else has both $b$ and $c$ as codomains. This isn't even isomorphic to the direct product of $b$ and $c$.
The most important thing to take away here is that the idea of "constructing" a product from the components that make it up does not generalize. At best you can take it apart, which is how it's defined in the first place.
If you know that $A\times B\times C$ and $(A\times B)\times C$ actually exist, you can infer that:
This means that $(A\times B)\times C$ is also a limit of $\{A,B,C\}$. Since limits are unique up to isomorphism, we can conclude that $A\times B\times C\cong(A\times B)\times C$. You can do the same for $A\times (B\times C)$ to show that all three are isomorphic.
Note: It might not even make sense to talk about associativity in an uncountable product, since the part of it that can be ordered must be countable. Even if you find the limit of an infinite diagram, this is still just a single operation on a single diagram.