construct a nondiagonal 2 x 2 matrix that is diagonalizable but not invertible.
Just write down a diagonal matrix with one zero on the diagonal and then apply an orthogonal transformation. E.g. if you start with the matrix:
A =
[1 ,0
0,1]
And take the orthogonal transformation to be:
S =
[cos(theta) , -sin(theta)
sin(theta), cos(theta]
then
the transformed matrix is:
S A S^(-1)
S^(-1) =
[cos(theta) , sin(theta)
-sin(theta), cos(theta]
If you take theta = pi/4 you get the matrix:
1/2 [1,1
1,1]