So I found the following post regarding this problem, but I don't find the solution to be helpful at all, so I decided to ask the question again. Furthermore, my question is a bit different than the one asked in the post shown below.
if m and n are sum of squares then so is $\frac{m}{n}$
I have to prove that if n and m are a sum of two squares and if $m\mid n$ then $\frac{n}{m}$ is also a sum of two fractions.
My attempt at a solution: $n=a^2 + b^2 $ and $m=x^2 + y^2$ Furthermore, the fraction $\frac{n}{m}=q$ where $q$ is the ratio between both numbers and we are trying to prove that $k$ is also a sum of two squares. I am thinking of also using the fact that any natural number can be written in the form $n=k^2p_1...p_r$, but I am kind of confused how to do it. Can somebody give me any ideas regarding this problem. Thanks!