Solution (source code)

= Solution

For this integral <Weierstrass equation of an elliptic curve>, compute
$$
\Delta=16m^4(m^2-1)^2,\qquad c_4=16(m^4-m^2+1).
$$
If an odd <prime> divides $m$ or $m^2-1$, then $c_4$ is a unit there and $\Delta$ is not. The <j-invariant of an elliptic curve> consequently has negative <valuation>. Since <good reduction> implies an integral j-invariant, such a <prime> cannot be a <prime> of good reduction, regardless of whether the displayed equation is minimal. Conversely, if it divides neither factor, this equation already has unit discriminant.

At five the good possibilities have $m\equiv\pm2$, so $m^2\equiv4$. At seven they have $m^2\equiv2$ or $4$. Direct <elliptic-curve point count over a finite field> gives the following nonzero ordinates, together with the three zero-ordinate points and $O$:
$$
\begin{array}{c|c|c|c}
p&m^2\bmod p&\text{points with }y\ne0&\#\widetilde E(\mathbb F_p)\\\hline
5&4&(2,\pm1),(3,\pm2)&8\\
7&2&(3,\pm2),(4,\pm1)&8\\
7&4&(2,\pm1),(5,\pm2)&8
\end{array}
$$
At either <prime>, <torsion-freeness of the formal group over Qp for odd p> makes reduction injective on all of $E(\mathbb Q)_{\rm tors}$, so its order is at most eight. Using only prime-to-$p$ injectivity here would leave an unjustified possible $p$-primary component.

All three nonzero <2-torsion> points $(0,0),(-1,0),(-m^2,0)$ are rational. The <rational point> $P=(m,m(m+1))$ lies on the curve, since $m(m+1)(m+m^2)=m^2(m+1)^2$. For an equation $y^2=x(x^2+ax+b)$ the <elliptic-curve addition formula> gives
$$
x(2P)=\frac{(x(P)^2-b)^2}{4x(P)(x(P)^2+ax(P)+b)}.
$$
Here $a=1+m^2$, $b=m^2$, so $2P=(0,0)$ and $P$ has order four. The point $(-1,0)$ is not in $\langle P\rangle$, whose only nonzero point of order two is $(0,0)$. Therefore $P$ and $(-1,0)$ generate a subgroup of order eight isomorphic to $\mathbb Z/4\mathbb Z\times\mathbb Z/2\mathbb Z$. The upper bound proves the <rational torsion in the family x times x plus one times x plus m squared>:
$$
\boxed{E(\mathbb Q)_{\rm tors}\cong\mathbb Z/2\mathbb Z\times\mathbb Z/4\mathbb Z.}
$$