Converse of Pythagoras' theorem: If the lengths of the sides of a triangle $T$ are $a$, $b$, and $c$, and if $a^2+b^2=c^2$, then the triangle is a right triangle and the side opposite to the right angle is the one whose length is $c$.
Proof: Construct a line segment $XY$ whose length is $a$. Then construct a line segment $YZ$ whose length is $b$ which is perpendicular to $XY$. By construction, the triangle $XYZ$ is a right triangle, and therefore, by Pythagoras' theorem and because we are assuming that $a^2+b^2=c^2$, the length of $XZ$ is equal to $c$. So, the triangle $XYZ$ is similar to the original triangle $T$. Since the triangle $XYZ$ is a right triangle, then so is $T$.
What I find peculiar about this proof is the fact that it uses Pythagoras' theorem in order to prove its converse.
It is not the only situation that I am aware of in which this occurs. For instance, there is a proof of the converse of Ceva's theorem which uses that theorem. But I am not aware of any example outside Euclidean Geometry.
Can anyone provide an example of a theorem of the type $A\implies B$ outside Geometry with a proof which uses the fact that $B\implies A$?

I've just found the following :
Proof: $\Rightarrow$) For each monomial of $f(\lambda x_0,...,\lambda x_n)$ you can take out a factor $\lambda^d$. Hence we have the statement (basically is the definition).
$\Leftarrow$) Suppose $f(x_0,...,x_n)=\sum_{i=1}^kf_{j_i}(x_0,...,x_n)$ where $f_{j_i}$ are homogeneus of degree $j_i$. Now we have: $$ f(\lambda x_0,...,\lambda x_n) = \sum_{i=1}^kf_{j_i}(\lambda x_0,...,\lambda x_n)\\ \lambda^d f(x_0,...,x_n) = \sum_{i=1}^k \lambda^{j_i}f_{j_i}(x_0,...,x_n) $$ where the operation in the LHS is the hypotesis and in the RHS we are using the arrow ($\Rightarrow$) of this proposition.
Hence the polynomial $t^d f(x_0,...,x_n) - \sum_{i=1}^k t^{j_i}f_{j_i}(x_0,...,x_n) \in K(x_0,...,x_n)[t]$ has infinite solutions ($K$ is infinite), so it is the $0$ polynomial.
Then in the RHS survives only the degree $d$ part and $f$ is homogeneus.