No. E.g. over $\mathbb R$, we have $\pmatrix{1&t\\ 0&-1}^2=I$ for any $t$. It also follows that
$$
\pmatrix{1&t\\ 0&-1}^2+\pmatrix{0&0\\ 0&1}\pmatrix{1&t\\ 0&-1}+\pmatrix{-1&0\\ 0&0}=0
$$
for any $t$.
Edit. Another counterexample (inspired by Dietrich Burde's answer). Let $u,v$ be any two vectors such that $v^Tu=0$. Then $X=uv^T$ is a solution to the equation $X^2=0$. In particular, if the underlying field is $GF(2)$ (the field consisting of only two elements $0$ and $1$, with $1+1=0$), the equation $Y^2=0$ for a $2\times2$ matrix $Y$ has exactly four solutions
$$
Y\in\left\{\pmatrix{0&0\\ 0&0},\ \pmatrix{0&1\\ 0&0},\ \pmatrix{0&0\\ 1&0},\ \pmatrix{1&1\\ 1&1}\right\}.
$$
And so does the equation $X^2=I$ over $GF(2)$: just put $X=Y+I$.