Problem: Let $n$ be a positive integer.
Determine the size of the largest subset of $\{ -n, -n+1, \dots, n-1, n\}$
which does not contain three elements $a$, $b$, $c$ (not necessarily distinct)
satisfying $a+b+c=0$.

Solution: The answer is $n$ with $n$ even and $n+1$ with $n$ odd;
the construction is to take all odd numbers.

To prove this is maximal, it suffices to show it for $n$ even;
we do so by induction on even $n \ge 2$ with the base case being trivial.
Letting $A$ be the subset, we consider three cases:
\begin{enumerate}[(i)]
  \ii If $|A \cap \{-n,-n+1,n-1,n\}| \le 2$,
  then by the hypothesis for $n-2$ we are done.
  \ii If both $n \in A$ and $-n \in A$,
  then there can be at most $n-2$ elements in $A \setminus \{\pm n\}$,
  one from each of the pairs $(1,n-1)$, $(2,n-2)$, $\dots$
  and their negations.
  \ii If $n, n-1, -n+1 \in A$ and $-n \notin A$,
  and at most $n-3$ more can be added,
  one from each of $(1, n-2)$, $(2, n-3)$, $\dots$
  and $(-2, -n+2)$, $(-3, -n+3)$, $\dots$.
  (In particular $-1 \notin A$.
  Analogous case for $-A$ if $n \notin A$.)
\end{enumerate}
Thus in all cases, $|A| \le n$ as needed.

\begin{remark*}
  A few examples of equality cases:
  \begin{itemize}
    \ii All odd numbers
    \ii All numbers with absolute value at least $n/2$
    \ii For $n$ even, the set $\{1, 2, \dots, n\}$
  \end{itemize}
  This list isn't exhaustive
  e.g.\ for $n=4$, the set $\{-3,2,3,4\}$ achieves the optimum.
\end{remark*}