I'm a bit confused of the notation $K(y)[x]$, is that simply $K[y][x]$ so... $K[y,x]?$
Anyways, here's my attempt at trying this before I get stuck. Since $f$ and $g$ are relatively prime, that means the ideal $(f,g)$ generates the whole polynomial ring $K[x]$. i.e. $\exists a,b$ such that $af + bg = 1$
I get stuck here because I don't know what $K(y)[x]$ is.
Any help?
By Gauss' lemma, to show that $f-Yg$ is irreducible in $K(y)[x]$ it suffices to show that it is irreducible in $K[y][x] = K[x][y]$. Now, since $f-Yg \in K[x][y]$ has degree $1$, if it is reducible it can be written as $f-Yg = (a-Yb)c$, with $a,b,c \in K[x]$ and $c$ a non-unit. This is a contradiction (why?).