Question:
prove or disprove that $(A+B)^2=A^2+2AB+B^2$ if $A=[a_{ij}]$ is a matrix of $3\times3$
such that $a_{ij}=1$ if i+j is even and it zero otherwise and $B=[b_{ij}]$ also a $3\times3$ matrix such that $b_ij=(-1)^{i-j}$.

SOLUTION:

To prove $(A+B)^2=A^2+2AB+B^2$ we need to generate the matrices A and B.
  before we generate the matrices we look at the definition of each matrix.

Starting with the L.H.S $A=[a_{ij}]$ where $a_{ij}=1$ and A is $3\times3$ matrix.
the matrix A is simple in the sense that: for each i=1,2,3,..,n
j=1,2,3,...,n before generating the both matrix remember the restriction that says $a_{ij}=1$ iff i+j=1 otherwise zero,
then
\begin{equation}
a_{11}=1,\quad a_{12}=0,\quad a_{13}=1,
\end{equation}
\begin{equation}
  a_{21}=0,\quad a_{22}=1,\quad a_{23}=0,
\end{equation}
\begin{equation}
  a_{31}=1,\quad a_{32}=0,\quad a_{33}=1
\end{equation}
then the matrix becomes \begin{equation}A=\left[\begin{array}{ccc}
1 & 0 & 1\\ 0 & 1 & 0\\1 & 0 & 1\end{array}\right]\end{equation} which is a unit matrix.
now we proceed to generating the matrix B using the definition of B, here $B=[a_{ij}]=(-1)^{i-j}$ where B is a $3\times3$ then \begin{equation}a_{11}=(-1)^{1-1}=1,\quad a_{12}=(-1)^{1-2}=-1,\quad a_{13}=(-1)^{1-3}=1\end{equation} \begin{equation}a_{21}=(-1)^{2-1}=-1,\quad a_{22}=(-1)^{2-2}=1,\quad a_{23}=(-1)^{2-3}=-1\end{equation}
\begin{equation}a_{31}=(-1)^{3-1}=1,\quad a_{32}=(-1)^{3-2}=-1,\quad a_{33}=(-1)^{3-1}=1\end{equation}
the the matrix B becomes \begin{equation}B=\left[\begin{array}{ccc}
1 & -1 & 1\\ -1 & 1 & -1\\ 1 & -1 & 1\end{array}\right]\end{equation}
Now it remains to show that  $(A+B)^2=A^2+2AB+B^2$
we first start with
\begin{equation}A+B=\left[\begin{array}{ccc}
1 & 0 & 1\\ 0 & 1 & 0\\1 & 0 & 1\end{array}\right] + \left[\begin{array}{ccc}
1 & -1 & 1\\ -1 & 1 & -1\\ 1 & -1 & 1\end{array}\right] = \left[\begin{array}{ccc}
2 & -1 & 2\\ -1 & 2 & -1\\ 2 & -1 & 2\end{array}\right]\end{equation}
\begin{equation}\Rightarrow(A+B)^2=(A+B)(A+B)\end{equation}
\begin{equation}=\left[\begin{array}{ccc}
2 & -1 & 2\\ -1 & 2 & -1\\ 2 & -1 & 2\end{array}\right]  \left[\begin{array}{ccc}
2 & -1 & 2\\ -1 & 2 & -1\\ 2 & -1 & 2\end{array}\right]=\left[\begin{array}{ccc}
9 & -6 & 9\\ -6 & 6 & -6\\ 9 & -6 & 9\end{array}\right]\end{equation}
which satisfies the proving of the left hand side . now it remains to show for the Right hand side. now for the right hand side $A^2+2AB+B^2$ we proof them one after the other, we begin with \begin{equation}A^2=A\times{A}=\left[\begin{array}{ccc}
1 & 0 & 1\\ 0 & 1 & 0\\1 & 0 & 1\end{array}\right] \left[\begin{array}{ccc}
1 & 0 & 1\\ 0 & 1 & 0\\1 & 0 & 1\end{array}\right]\end{equation}   \begin{equation}=\left[\begin{array}{ccc}
2 & 0 & 2\\ 0 & 1 & 0\\2 & 0 & 2\end{array}\right]\end{equation}

and

\begin{equation}2AB=2\left[\begin{array}{ccc}
1 & 0 & 1\\ 0 & 1 & 0\\1 & 0 & 1\end{array}\right] \left[\begin{array}{ccc}
1 & -1 & 1\\ -1 & 1 & -1\\1 & -1 & 1\end{array}\right]\end{equation}
\begin{equation}=\left[\begin{array}{ccc}
4 & -4 & 4\\ -2 & 2 & -2\\4 & -4 & 4\end{array}\right]\end{equation}

and for

\begin{equation}B^2=\left[\begin{array}{ccc}
1 & -1 & 1\\ -1 & 1 & -1\\1 & -1 & 1\end{array}\right] \left[\begin{array}{ccc}
1 & -1 & 1\\ -1 & 1 & -1\\1 & -1 & 1\end{array}\right]\end{equation}
=\begin{equation}\left[\begin{array}{ccc}
3 & -3 & 3\\ -3 & 3 & -3\\3 & -3 & 3\end{array}\right]\end{equation}

now we compute $A^2+2AB+B^2$

= \begin{equation}\left[\begin{array}{ccc}
2 & 0 & 2\\ 0 & 1 & 0\\2 & 0 & 2\end{array}\right]   +    \left[\begin{array}{ccc}
4 & -4 & 4\\ -2 & 2 & -2\\ 4 & -4 & 4\end{array}\right]  +  \left[\begin{array}{ccc}
3 & -3 & 3\\ -3 & 3 & -3\\3 & -3 & 3\end{array}\right]\end{equation}     \begin{equation}=\left[\begin{array}{ccc}
9 & -7 & 9\\ -5 & 6 & -5\\ 9 & -7 & 9\end{array}\right]\end{equation} hence we can conclude that  $(A+B)^2\neq{A^2+2AB+B^2}$