Let $x=\frac{A}{B}$ be a positive rational number in lowers terms (i.e., $A, B\in\mathbb{N}$ and $hcf(A,B)=1$). Prove that $\sqrt{x}$ is rational if and only if $A$ and $B$ are both perfect squares. (Remember that your proof should work for cases like $A=40$, where $A$ is not a perfect square but has a factor that is a perfect square.)
I know prime factorization is involved but that's basically it. Proving that $\sqrt{y}$ (for some number y) is rational if and only if $y$ is a perfect square I can do. Applying that that to the fraction mentioned above? Not so much.
Any and all help would be appreciated. Thank you.
First of all, you have an if and only if statement, so you need to prove both directions.
One of them should be trivial. If $A,B$ are perfect squares, then it shuold be easy to show that $\sqrt x$ is rational.
Now, for the other direction, follow the same steps you are used to: