$ax \equiv b \mod N$
$1239x \equiv 5 \mod 154$
$7x \equiv 5 \mod 154$
$315x \equiv 5 \mod 154$
$x \equiv \frac{1}{63} \mod 154$
$63x + 154y = 1$
$\gcd(63,154) = 7 \neq1$ So there's not an inverse.
Is this the right method to, eventually, find the inverse when $b\neq1$?
$$7x\equiv 5\mod{154}$$ has no solutions as you have correctly deduced. In general when we have that $$ax\equiv b\mod{ac},\qquad a\ne1$$ and $\gcd{(a,b)}=1$ then the equation has no solutions. This follows from the fact that we would have for any solution $x$ $$ax=b+kac$$ $$\implies b\equiv0\mod{a}$$ But if $\gcd{(a,b)}=1$ then $b\not\equiv0\text{ mod }a$ - a contradiction.