I was browsing this post: Prove that $a^2 + b^2 + c^2 $ is not a prime number
One of the answer has the following statement:
"If the numbers $a$ and $c$ are coprime, then the equation $ac=b^2$ together with unique factorization forces both $a$ and $c$ to be squares."
I know this should be a trivial question. However, I am not sure how to show the above statement is correct? Any help will be greatly appreciated.