[proofplan]
The proof is a two-line matrix computation once the standard matrix form of a binary quadratic form is set up. We attach to each binary quadratic form $f(x, y) = ax^2 + bxy + cy^2$ its symmetric matrix $M_f = \begin{pmatrix} a & b/2 \\ b/2 & c \end{pmatrix}$, so that $f(x, y) = (x, y) M_f (x, y)^\top$ and $\operatorname{disc}(f) = -4 \det M_f = b^2 - 4ac$. The action of $A \in \mathrm{SL}_2(\mathbb{Z})$ that takes $f$ to an equivalent form $g$ transforms matrices by $M_g = A^\top M_f A$ (under a convention we fix explicitly); the determinant identity $\det M_g = (\det A)^2 \det M_f$ then yields $\det M_g = \det M_f$, because $\det A = 1$. The discriminant, being $-4$ times the determinant, is consequently preserved.
[/proofplan]
[step:Fix the matrix representation of a BQF and the discriminant formula]
A (real) binary quadratic form is a homogeneous polynomial of degree $2$ in two variables. For a form $f(x, y) = a x^2 + b xy + c y^2$ with $a, b, c \in \mathbb{Z}$, define the Gram matrix
\begin{align*}
M_f : \mathbb{Z}^2 &\to \mathbb{Z}^2 \otimes \mathbb{Z}^2 \\
f &\mapsto \begin{pmatrix} a & b/2 \\ b/2 & c \end{pmatrix} \in \mathrm{Mat}_{2 \times 2}(\mathbb{Q}),
\end{align*}
so that for every column vector $v = (x, y)^\top \in \mathbb{R}^2$,
\begin{align*}
f(x, y) &= v^\top M_f v.
\end{align*}
The discriminant of $f$ is
\begin{align*}
\operatorname{disc}(f) &= b^2 - 4ac = -4 \det M_f,
\end{align*}
since $\det M_f = ac - b^2/4$ gives $-4 \det M_f = b^2 - 4 ac$.
[/step]
[step:Translate equivalence of BQFs into a matrix identity]
Two integral BQFs $f$ and $g$ are equivalent if there exists $A \in \mathrm{SL}_2(\mathbb{Z})$ such that $g = A f$, meaning
\begin{align*}
g(x, y) &= f(A \cdot (x, y)^\top),
\end{align*}
where $A$ acts on column vectors by left multiplication. Writing $v = (x, y)^\top$ and using the matrix form from Step 1,
\begin{align*}
g(x, y) &= f(Av) = (Av)^\top M_f (Av) = v^\top (A^\top M_f A) v.
\end{align*}
On the other hand, by definition of $M_g$, $g(x, y) = v^\top M_g v$. Two symmetric matrices representing the same quadratic form on $\mathbb{R}^2$ are equal; therefore
\begin{align*}
M_g &= A^\top M_f A.
\end{align*}
[guided]
The substitution $v \mapsto Av$ transforms the Gram matrix by $M \mapsto A^\top M A$. This is the standard "change-of-coordinates" rule for symmetric bilinear forms: if $B(v, w) = v^\top M w$ is the bilinear form associated to $M$, then after pulling back along $v \mapsto Av$,
\begin{align*}
B(Av, Aw) &= (Av)^\top M (Aw) = v^\top (A^\top M A) w,
\end{align*}
so the pulled-back form has Gram matrix $A^\top M A$.
One has to fix a convention: does $A$ act on column vectors by $A v$ or on row vectors by $v A^\top$? Either choice is acceptable, but they must be used consistently. We have chosen the column-vector convention, under which the Gram matrix transforms as $A^\top M A$. Under the row-vector convention the transformation would be $A M A^\top$; the determinant identity is unchanged either way, since $\det(A^\top) = \det(A)$.
Why do we insist that $M_g$ be determined from $g$ uniquely as a symmetric matrix, rather than merely up to some ambiguity? Because two symmetric matrices with real entries that define the same quadratic form $v \mapsto v^\top M v$ on $\mathbb{R}^2$ must be equal: the quadratic form determines its polarisation, which determines the symmetric bilinear form, which determines its matrix once a basis is fixed. Hence the identity $M_g = A^\top M_f A$ is not merely one valid choice — it is forced.
[/guided]
[/step]
[step:Take determinants and apply $\det A = 1$]
Taking determinants of the identity $M_g = A^\top M_f A$:
\begin{align*}
\det M_g &= \det(A^\top M_f A) = \det(A^\top) \det(M_f) \det(A) = (\det A)^2 \det M_f,
\end{align*}
using multiplicativity of the determinant and $\det(A^\top) = \det(A)$.
Since $A \in \mathrm{SL}_2(\mathbb{Z})$ by hypothesis, $\det A = 1$, hence $(\det A)^2 = 1$, and
\begin{align*}
\det M_g &= \det M_f.
\end{align*}
[/step]
[step:Conclude that the discriminant is invariant]
Multiplying by $-4$ and applying the formula from Step 1:
\begin{align*}
\operatorname{disc}(g) &= -4 \det M_g = -4 \det M_f = \operatorname{disc}(f).
\end{align*}
Equivalent BQFs therefore have the same discriminant.
[/step]