proving a map to a product space is a quotient map

I got a question on my topology exam that I did not manage to solve. The exam is over, so now I ask here.

Let $$X$$ be a topological space. For each equivelance relation $$R$$ on $$X$$, let $$X/R$$ be the set of $$R$$-equivalence classes in $$X$$, and let $$q_R: X \to X/R$$ be the canonical quotient map. We say that $$R$$ is good if the quotient space $$X/R$$ is Hausdorff.

Define the product space $$Y = \prod_{\text{R is good}} X/R.$$

Let $$f:X \to Y$$ be the function with $$\pi_R \circ f = q_R$$ for each good $$R$$, where $$\pi_R: Y \to X/R$$ is the $$R$$-th projection mapping. Let $$Z = f(X)$$ be its image, with the subspace topology from $$Y$$.

Define $$g:X \to Z$$ to be the corestricted function $$f$$, so that $$g(x) = f(x)$$ for each $$x \in X$$.

At last, the problem: prove that $$g:X \to Z$$ is a quotient map.

What I have done already is that I have shown that $$g$$ is a continuous surjection (with Hausdorff image Z. I'm not sure if this is relevant, but one of the earlier sub-problems asked me to do so.) This part was not too challenging.

So I have shown the "$$\implies$$" direction of the required statement $$U \in Z \text{ is open} \iff g^{-1}(U) \in X \text{ is open}.$$ But the other direction seems pretty tricky with no knowledge of $$X$$.

I've tried showing that $$g$$ is an open and a closed map, but I can't determine if this is true. Working with the product topology of an arbitrary cardinality does my head in!

$$f$$ is continuous by the universal property of initial topologies. The corestricted $$g$$ is then also continuous. By definition it's onto and $$Z$$ is Hausdorff as a subspace of the Hausdorff $$Y$$ (as all $$R$$ are good, all factor spaces are by definition Hausdorff, and arbitrary products of Hausdorff spaces are Hausdorff, and subspaces inherit it too).
If $$\pi_R^{-1}[U]$$ is a subbasic shaped subset of $$Y$$ then $$f^{-1}[\pi_R^{-1}[U]] = (\pi_R \circ f)^{-1}[U]= q_R^{-1}[U]$$ is open iff $$U$$ is open in $$X{/}R$$. Try to use that to show $$g$$ quotient.