Let
A={{0,0},{1,0},{1,1}}; b={{5},{1},{2}};
(a) Find the least squares solution of the inconsistent system A.x = b.
x=Inverse[Transpose[A].A].Transpose[A].b
or, more simply:
x=PseudoInverse[A].b
(b) Use your answer in part (a) to find the projection of b onto the column space of A.
A.x