Let $a,b\in\mathbb{N}$ be coprime, $p\in k[z]$ a polynomial of degree $g$. Then the bivariate polynomial $q\in k[x,y]$, given by \begin{equation*} q(x,y)=y^{b\cdot g}p\left(\frac{x^{a}}{y^{b}}\right) \end{equation*} is irreducible if and only if $p$ is.
One direction is obvious: If $p$ is reducible and factors as \begin{equation*} p(z)=p_{1}(z)\cdot...\cdot p_{n}(z)\text{,} \end{equation*} and $g_{1},...,g_{n}$ are the respective degrees of $p_{1},...,p_{n}$, then $q$ factors as \begin{equation*} q(x,y)=\prod_{i=1}^{n}y^{b\cdot g_{i}}p_{i}\left(\frac{x^{a}}{y^{b}}\right)\text{,} \end{equation*} so $q$ is reducible.
One can try to prove the other direction by assuming that $q=\prod_{i=0}^{n}q_{i}$ is reducible. Then $p(z)=\prod_{i=0}^{n}q_{i}(z,1)$. But how do I know that none of the $q_{i}$s is constant?
Since you already proved one direction, I'll give you several hints for the other direction and hope you can reach to a solution (without much algebraic geometry). Let us assume that $p$ is nonconstant irreducible and $q$ isn't. I am assuming that $a,b$ are positive integers.