The following query is an offshoot of this answer to a closely related post.
Denote the classical sum of divisors of the positive integer $x$ by $\sigma(x)=\sigma_1(x)$.
The topic of odd perfect numbers likely needs no introduction.
Euler proved that a hypothetical odd perfect number (which is an odd $N$ satisfying $\sigma(N)=2N$), if one exists, must necessarily have the form $$N = p^k m^2$$ where $p$ is the special prime satisfying $p \equiv k \equiv 1 \pmod 4$ and $\gcd(p,m)=1$.
Let us first consider the multiplicative form of $$M = m^2 - p^k = 2^r t,$$ where $\gcd(2,t)=1$ and $r \geq 2$.
FredH gave an unconditional proof for the assertion that $m^2 - p^k$ is not a square in this answer. Additionally, note that $m^2 - p^k$ is not squarefree (basically because $4 \mid (m^2 - p^k)$). It follows (from mathlove's answer) that, $2^r$ is a square (and therefore, $r$ is even) if and only if $\gcd(\text{square part of } M,\text{squarefree part of } M)=1$.
For posterity's sake, I reproduce mathlove's answer below:
This is not a direct answer to the question, but I merely wanted to point out that there is an error in your proof that $r$ is even and $t$ is squarefree.
You have $m^2 - p^k = 2^r t$ where $\gcd(2,t)=1$ and $r \geqslant 2$, and you know that $m^2 - p^k$ is neither a square nor squarefree. Then, you used the fact that if $2^rt$ is neither a square nor squarefree, then $2^rt$ can be represented as the product of a square larger than $1$ and a squarefree integer larger than $1$. The fact itself is correct. Using the fact, it seems that you thought that there are only two possibilities $(2^r,t)=(\text{square},\text{squarefree}),(\text{squarefree},\text{square})$ from which you concluded that $r$ is even and $t$ is squarefree.
You are missing the other possibilities. For example, you are missing the following cases :
$(2^{r-1},2t)=(\text{square},\text{squarefree})$ where $r$ is odd and $t$ is squarefree.
$(2^{r-2},2^2t)=(\text{squarefree},\text{square})$ where $r=3$ and $t$ is a square.
More importantly, if you want to represent $2^rt$ as $(\text{square})\times (\text{squarefree})$, then I think that you need to know how to represent $t$ as $(\text{square})\times (\text{squarefree})$ including the cases where $t$ is either a square or squarefree. I'll write all the possibilities in the following :
If $r$ is even and $t$ is squarefree, then $2^rt$ can be represented as $\underbrace{2^r}_{\text{square}}\times \underbrace{t}_{\text{squarefree}}$.
If $r$ is odd and $t$ is squarefree, then $2^rt$ can be represented as $\underbrace{2^{r-1}}_{\text{square}}\times \underbrace{2t}_{\text{squarefree}}$.
If $r$ is odd and $t$ is a square, then $2^rt$ can be represented as $\underbrace{2^{r-1}t}_{\text{square}}\times \underbrace{2}_{\text{squarefree}}$.
If $r$ is even and $t=PQ^2$ is neither squarefree nor a square where $P$ is squarefree, then $2^rt$ can be represented as $\underbrace{2^rQ^2}_{\text{square}}\times \underbrace{P}_{\text{squarefree}}$.
If $r$ is odd and $t=PQ^2$ is neither squarefree nor a square where $P$ is squarefree, then $2^rt$ can be represented as $\underbrace{2^{r-1}Q^2}_{\text{square}}\times \underbrace{2P}_{\text{squarefree}}$.
The possibility that we can represent $2^rt$ as $\underbrace{2^r}_{\text{square}}\times \underbrace{t}_{\text{squarefree}}$ is just one of these possibilities. How to represent $2^rt$ as $(\text{square})\times (\text{squarefree})$ depends on how to represent $t$ as $(\text{square})\times (\text{squarefree})$.
Here is my:
QUESTION
What conditions on $X$ will guarantee that $\gcd(\text{square part of } X,\text{squarefree part of } X)=1$, if $X$ is neither a square nor squarefree? (Note that $X$ may not be $M$.)