[step:Force the substitution matrix to be $\pm I_2$ and derive the contradiction]
Let $T \in \mathrm{SL}_2(\mathbb{Z})$ satisfy $g(v) = f(Tv)$ for $v \in \mathbb{Z}^2$. (Strictly speaking we should consider $T \in \mathrm{GL}_2(\mathbb{Z})$ if the equivalence is improper; we treat proper equivalence, as the convention in this text. The improper case is analogous using $\det T = -1$.) Since $g(\pm 1, 0) = a$ and the only pairs representing $a$ under $f$ are $(\pm 1, 0)$, the map $T$ sends $(1, 0)$ to $(\pm 1, 0)$ and $(-1, 0)$ to the other. So the first column of $T$ is $(\pm 1, 0)^\top$.
Since $\det T = 1$, the second column of $T$ has the form $(m, \pm 1)^\top$ for some $m \in \mathbb{Z}$ (the $\pm 1$ being the cofactor needed for determinant $1$). So $T$ has one of the four shapes
\begin{align*}
T &= \begin{pmatrix} \varepsilon_1 & m \\ 0 & \varepsilon_2 \end{pmatrix}, \qquad \varepsilon_1, \varepsilon_2 \in \{\pm 1\}, \ \varepsilon_1 \varepsilon_2 = 1, \ m \in \mathbb{Z}.
\end{align*}
Thus $\varepsilon_2 = \varepsilon_1$; write $\varepsilon := \varepsilon_1 = \varepsilon_2$.
We compute $g = f \circ T$ explicitly:
\begin{align*}
g(x, y) &= f(\varepsilon x + my, \varepsilon y) \\
&= a(\varepsilon x + my)^2 + b(\varepsilon x + my)(\varepsilon y) + c(\varepsilon y)^2 \\
&= a(x + \varepsilon m y)^2 + b \varepsilon^2 (x + \varepsilon m y) y + c y^2 \\
&= a x^2 + (2 a \varepsilon m + b)\, xy + (a m^2 + b \varepsilon m + c)\, y^2,
\end{align*}
using $\varepsilon^2 = 1$. Matching coefficients with $g = (a, -b, c)$:
\begin{align*}
a &= a \qquad \checkmark \\
-b &= 2 a \varepsilon m + b \\
c &= a m^2 + b \varepsilon m + c.
\end{align*}
The third equation gives $a m^2 + b \varepsilon m = 0$, i.e. $m(am + b\varepsilon) = 0$. Either $m = 0$, or $am = -b\varepsilon$.
If $m = 0$: the second equation becomes $-b = b$, hence $b = 0$, contradicting $b \neq 0$.
If $am = -b\varepsilon$: substitute into the second equation:
\begin{align*}
-b &= 2 a \varepsilon m + b = 2 \varepsilon \cdot (am) \cdot 1 + b = 2 \varepsilon \cdot (-b \varepsilon) + b = -2b + b = -b,
\end{align*}
which is an identity, so the second equation is consistent. But $am = -b\varepsilon$ requires $a \mid b\varepsilon$, i.e. $a \mid b$. Since $0 < |b| < a$, this is impossible.
Both sub-cases yield a contradiction, so our assumption $b' = -b \neq b$ is false. Hence $b' = b$, and $f = g$.
[/step]