I have two random variables $X$ and $Y$, specific elements that these random variables can take are $x$ and $y$. Now, say I define a random variable $f(x,Y)$ (a function of the random variable $Y$) as, $$f(x,Y)=g(x,Y)$$ Note here that $x$ is a specific value and $Y$ is the random variable. This is true for every $x$. I have a straightforward, and maybe silly doubt, is it true that $$f(X,y)=g(X,y)$$ Here I've flipped the random variable and the specific variable around. Intuitively, looking at random variables as functions, it should be true. Is there a more convincing argument?
Update: Since there was some confusion, it is a part of a bigger problem, where $$ f(x,Y)= \begin{cases} g(x,Y) &\text{if } E \\ h(x,Y) &\text{otherwise } \end{cases}$$ for some event $E$