The case of squares (the last remaining one) can probably be solved by brute-force using calculations on various square identities. Here's a note on it for the potential computer attack and a short explanation below. I couldn't do it on a laptop, will try to run it on a more powerful machine - if anyone is willing to try it too, they are most welcome. Also currently trying to run it through Aristostle to formalize if possible.
To obtain a computer-verifiable proof one must produce a finite certificate of unsatisfiability for a finite universe. Concretely, fix a bound $N$ and consider the Boolean variables $X_n$ for $2\le n\le N$, interpreted as $X_n=\text{true}\iff g(n)=+1$ and $X_n=\text{false}\iff g(n)=-1$. For each exact reciprocal-square identity\[
\sum_{u\in U}\frac1{u^2}=\sum_{v\in V}\frac1{v^2}
\]in a chosen finite library $B$, and for each scale $m$ such that $mU\cup mV\subseteq\{2,\dots,N\}$, add two CNF clauses forbidding the two opposite-monochromatic sign patterns on the scaled sets:\[
\neg\bigl(\forall u\in U\, X_{mu}\ \wedge\ \forall v\in V\, \neg X_{mv}\bigr),\qquad
\neg\bigl(\forall u\in U\, \neg X_{mu}\ \wedge\ \forall v\in V\, X_{mv}\bigr),
\]equivalently the clauses\[
\Big(\bigvee_{u\in U}\neg X_{mu}\Big)\ \vee\ \Big(\bigvee_{v\in V}X_{mv}\Big),\qquad
\Big(\bigvee_{u\in U}X_{mu}\Big)\ \vee\ \Big(\bigvee_{v\in V}\neg X_{mv}\Big).
\]Finally, enforce that the coloring is non-constant by adding $\bigvee_{n=2}^N X_n$ and $\bigvee_{n=2}^N \neg X_n$. If a SAT solver returns UNSAT for the resulting CNF, then this constitutes a finite certificate that every non-constant $g:\{2,\dots,N\}\to\{\pm1\}$ realizes some scaled identity in $B$ with opposite constant signs on the two sides, hence yields a finite set $T\subset\{2,\dots,N\}$ with $\sum_{m\in T}g(m)/m^2=0$. A fully checkable proof is obtained by recording (i) the explicit identity library $B$ (each identity verified independently by exact rational arithmetic), (ii) the bound $N$, and (iii) the solver-produced unsatisfiability certificate (e.g. a DRAT/FRAT proof) together with a standard proof checker verifying the certificate against the CNF.