Consider the binary quadratic form $f(x,y) = x^2 + k y^2$ over the integers.
If there exists integers $u,v$ such that $f(u,v) = a$, we say that the form can represent $a$.
I can show that if $f$ represents $a$ and $b$ that it must also represent $ab$.
Is it possible to partially invert this and show that if $f$ represents $a$ and $ab$ it must also represent $b$?
If not, what are some necessary conditions which would allow this conclusions to go through? Maybe some restriction on the class number $h(-4k)$? I may have misunderstood, but I saw a lecture that seemed to assume this is obvious when the class number is odd. I'm hoping there is a simple reason it is true in general, but am having trouble proving anything.
My attempt
First note: $$ \begin{aligned} (r^2 + k s^2) (t^2 + k u^2) &= (r t)^2 + (k s u)^2 + k((s t)^2 + (r u)^2) \\ &= (r t + k s u)^2 - 2k r u s t + k (s t - r u)^2 + k 2 r u s t \\ &= (rt+ksu)^2 + k (st-ru)^2 \\ \end{aligned} $$
Therefore if $f$ represents $a$ and $b$ that it must also represent $ab$.
Now focusing on whether representation of $a$ and $ab$ implies representation of $b$, I'll start with some given representation of $a$ and $ab$ and try to construct a representation of $b$. $$ \begin{aligned} a &= r^2 + k s^2 \\ ab &= x^2 + k y^2 \\ \end{aligned} $$ Then using the identity above, try to solve for $t,u$ from $$ \begin{aligned} x &= (rt+ksu) \\ y &= (st-ru) \\ \end{aligned} $$ as this would give $t^2 + k u^2 = b$.
Combining the equations we find: $$ \begin{aligned} sx - ry &= u (k s^2 + r^2) = u a \\ rx + ksy &= t (r^2 + k s^2) = t a \\ \end{aligned} $$ We will get the desired conclusion if we can show $$ \begin{aligned} sx - ry &= 0 \pmod{a} \\ rx + ksy &= 0 \pmod{a} \\ \end{aligned} $$ so that our solutions for $t$ and $u$ are integers.
I'm stuck here, and not sure if this is even the appropriate path to try to prove this.
Inspired by the conditions @WhatsUp found experimentally, I can now prove they are necessary.
That is: If $k>1$ then it must be square free, and for $k \ge 4$ it must be 1 or 2 mod 4.
Note: These conditions are not sufficient, as noted by the $k=14$ case tested by WhatsUp.
Step 1. Proving that $k>1$ cannot be a square.
If $k=n^2 > 1$, then
$f(0,1) = k$
$f(n,1) = 2k$
but $f$ cannot represent 2 since it is less than $k$ and not a square.
So to have this property, if $k>1$ it cannot be a square.
Step 2. Proving that $k>1$ must be square free.
If $k=an^2$ with $a,n>1$ and $a$ is square free, then
$f(0,1) = an^2$
$f(n,0) = n^2$
but $f$ cannot represent $a$ because it is less than $k$ and not a square.
So combined with the previous step we can conclude that for the quadratic form to have this property, if $k>1$ it must be square free.
Step 3. Proving the $\pmod 4$ conditions.
If $k=4n$ then it is not square free, and so if $k>1$ and $k \equiv 0 \pmod 4$ the quadratic form will not have the desired property.
For $k=4n+3$ it is helpful to split into a case analysis of when $(n+1)$ is a square or not.
If $k=4n+3$ with $n>0$ and $(n+1)$ not a square, then
$f(1,1) = 1 + k = 4(n+1)$
$f(2,0) = 4$
but $f$ cannot represent $(n+1)$ because it is less than $k$ and not a square.
If $k=4n+3$ with $n>0$ and $(n+1)=m^2$, then
$k = 4(m^2-1)+3 = 4m^2 - 1 = (2m+1)(2m-1)$
$f(2m + 1, 1) = (2m+1)^2 + (2m+1)(2m-1) = (2m+1)(4m)$
$f(2m - 1, 1) = (2m-1)^2 + (2m+1)(2m-1) = (2m-1)(4m)$
$f(2,0) = 4$
As $(2m+1)m$ and $(2m-1)m$ are less than $k$, they must both be squares to be representable. Since $\gcd(2m+1,m)=1$, and similarly $\gcd(2m-1,m)=1$, this also requires $2m+1$, $2m-1$, and $m$ to all be squares for these values to be representable. However there are no integer squares that differ by 2, so this is impossible.
All together this allows us to conclude that for the quadratic form to have the desired property, if $k \ge 4$ then $k$ must be 1 or 2 mod 4.
Other Notes
I don't quite see what is going on yet, but the "bad" values of k seem to be related to almost all values that can be taken by a similar "form" of quadratic forms.
$$k = m^2 n - r^2$$
The main part that doesn't look nice in this is that the $n=1$ case seems to limit $r \in \{0,1\}$.
Consider $k = m^2$ with $m>1$
We've already shown these values of $k$ do not work.
Consider $k = m^2 - 1 > 4$
I couldn't find a quick example, but using previous work:
If $m$ is even, then $m^2 = 4t$, so $k = m^2 - 1 = 4(t-1) + 3$.
If $m$ is odd, then $m^2 = 4t + 1$, so $k = m^2 -1 = 4t + 0$.
So these $k$ will not work.
This appear to be the limit of general arguments against the difference of squares, as WhatsUp tests found that $k = 3^2 - 2^2 = 5$ was probably okay.
Consider $k = m^2n - 1$ with $m,n > 1$ and $n$ square-free
$f(1,1) = m^2n$
$f(m,0) = m^2$
cannot represent $n$, so this value of $k$ will no work.
More generally,
$k = m^2 n - r^2$ with $m>1$, $k>n>1$, and $n$ square free
$f(r,1) = m^2 n$
$f(m,0) = m^2$
Cannot represent $n$, so this value of $k$ will not work.
Unlike the $n=1$ case, here the values of $r$ are much less restricted.
Since another quadratic form seems to be rearing its head, there is probably something simpler connecting all this. Hopefully someone else can see the thread I am missing, and unravel the rest.