Let $R$ be a commutative ring and $I$ its ideal. Consider $D(I):=\{x \in R\,\, |\,\, x+x \in I \}$, which is (easy to show) an ideal of $R$.
Assuming $R = \mathbb{Z}$ and $n \ge 2$, then $D(n\mathbb{Z})=n\mathbb{Z} \iff n\,\,\,\,$is odd
Any tips to show that? I am sure that the solution is almost elementary, but there must be a relation that I am missing.
Obviously you always have $D(I)\supseteq I$.
When $R=\mathbb Z$, the condition means that $D(I)=\{z\in \mathbb Z\mid 2z\in I\}$.
If $n$ is even, for example $n=2$, then you obviously have that $1\in D(2\mathbb Z)\supsetneq2\mathbb Z$.
When $n$ is odd, you have to take $z\in\mathbb Z$ and consider what happens when $2z\in n\mathbb Z$.
Just look: $2z=nr$ with $n$ odd implies that $2|r$. Do you see how to finish?