Construct/Verify an example of a pair of anticommuting matrices each having a zero eigenvalue, and a shared eigenvector.

ClearAll[a, b, e, d, h]

d = 1 ;
a = DiagonalMatrix[{1,-1,d}] ;
b = DiagonalMatrix[{0,0,d}] ;
h = DiagonalMatrix[{0,0,1}] ;
b[[1,2]] = 1 ;
b[[2,1]] = 1 ;
Grid[{
{"A = ",
a // MatrixForm},
{"B = ",
b // MatrixForm},
{"{A,B} = ",
a .b + b .a // MatrixForm},
{"[A,B] = ",
a .b - b .a // MatrixForm},
{"{A,H} = ",
a .h + h .a // MatrixForm},
{"[A,H] = ",
a .h - h .a // MatrixForm},
{"{B,H} = ",
b .h + h .b // MatrixForm},
{"[B,H] = ",
b .h - h .b // MatrixForm}} ] 

Eigensystem[a]
Eigensystem[b]

e  = {0,0,1} ;
a e // MatrixForm
b e // MatrixForm

Check syntax.  These should not commute:

ClearAll[x, z]
z = DiagonalMatrix[{1,-1}] ;
x = DiagonalMatrix[{0,0}] ;
x[[1,2]] = 1 ;
x[[2,1]] = 1 ;
Grid[{
{"x = ",
x // MatrixForm},
{"z = ",
z // MatrixForm},
{"{x,z} = ",
x. z + z .x // MatrixForm}, (*needed dots between products!*)
{"[x,z] = ",
x .z - z .x // MatrixForm}} ]

Counter example for Shankar 1.17 ?

ClearAll[a, b, h]

a = {{0,1},{0,0}} ;
b = DiagonalMatrix[{1,0}] ;
h = DiagonalMatrix[{0,0}] ;

Grid[{
{"A = ",
a // MatrixForm},
{"B = ",
b // MatrixForm},
{"H = ",
h // MatrixForm},
{"{A,B} = ",
a .b + b .a // MatrixForm},
{"[A,B] = ",
a .b - b .a // MatrixForm},
{"{A,H} = ",
a .h + h .a // MatrixForm},
{"[A,H] = ",
a .h - h .a // MatrixForm},
{"{B,H} = ",
b .h + h .b // MatrixForm},
{"[B,H] = ",
b .h - h .b // MatrixForm}} ] 

a = {{0,1, 0},{0,0, 0},{0,0, 1}} ;
b = DiagonalMatrix[{1,0, 1}] ;
h = DiagonalMatrix[{0,0, 1}] ;

Grid[{
{"A = ",
a // MatrixForm},
{"B = ",
b // MatrixForm},
{"H = ",
h // MatrixForm},
{"{A,B} = ",
a .b + b .a // MatrixForm},
{"[A,B] = ",
a .b - b .a // MatrixForm},
{"{A,H} = ",
a .h + h .a // MatrixForm},
{"[A,H] = ",
a .h - h .a // MatrixForm},
{"{B,H} = ",
b .h + h .b // MatrixForm},
{"[B,H] = ",
b .h - h .b // MatrixForm}} ]