Solution (source code)

= Solution

For points $P,Q$ on a smooth plane cubic, draw the line through them, using the tangent at $P$ when $P=Q$, and let its third intersection with the cubic be $R$. The <chord-and-tangent group law> defines $P+Q$ as the reflection of $R$ in the $x$-axis; the point at infinity $O$ is the identity and $-(x,y)=(x,-y)$.

If $P,Q\in E(\mathbb Q)$, their chord or tangent has rational coefficients. Substitution into the cubic gives a polynomial with rational coefficients for which two intersection roots are rational, so the third is rational as well. The identity and inverse of every rational point are rational, and closure under addition follows. Assuming the elliptic-curve law is a group law, $E(\mathbb Q)$ is therefore a subgroup of $E(\overline{\mathbb Q})$.