Let $(X,Y)$ be a discrete random vector, and $X,Y$ are independent random variables, where there exists two non-negative functions, $q,r : \mathbb{R} \to [0,\infty)$ and $a>0$ such that $P_X(x)=aq(x)$ and $P_Y(y)=\frac{1}{a} r(x)$.
Given that $Z=g(X)Y$ ($g: \mathbb{R} \to \mathbb{R}$), and $P_X(x)$ and $P_{Y|X}(y|x)$ are known.
write $P_{Z|X}(z|x)$ using them
My attempt until now:
$P(Z=z | X=x)=P(g(X)Y=z | X=x)=P(Y=\frac{z}{g(x)}| X=x)$.
And now I need to take care of the case $g(x) = 0$, but with all my attempts I'm getting stuck, and here's an attempt :
If $g(x)=0$ then $Z=0$, so $P(Z=0 | X=x)=P(g(X)=0|X=x)$
I'm not really sure how to continue and if what I wrote is legitimate.
Any help is really appreciated.