Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 7.3 Exercise 7.3.31
Solution: We begin with a lemma.
Lemma: Let $R$ be a ring with $1 \neq 0$. If $x \in R$ is a unit, then $x$ is not nilpotent.
Proof: Suppose to the contrary that $xy = yx = 1$ and $x^n = 0$. Then we have $$1 = 1^n = (xy)^n = x^ny^n = 0,$$ a contradiction. $\square$
Evidently, $A^2 = B^2 = 0$, while $(A+B)^2 = 1$. By the lemma, $A+B$ is not nilpotent. Since $\mathfrak{N}(\mathsf{Mat}_2(\mathbb{Z}))$ is not closed under addition, it is not an ideal of any ring.