The Shanghai Institute of Applied Physics (SINAP) is embarking on its first X-ray free-electron laser (FEL) project. It is a cascading high-gain harmonic generation FEL. Microwave instabilities driven by various effects, especially the space-charge force, will degrade the quality of the electron beam before entering into the undulator. However, inside the undulator, the occurrence of microbunching becomes an utmost important ingredient for the generation of coherent radiation. In short, controlled and uncontrolled microwave instabilities must be fully understood in such a project. These are the slides of a series of eight-hour lectures given at the SINAP in June of 2013, with the intention of a fully understanding of the microbunching phenomenon. The sections of wake field and impedance theory are added as an introduction for those who are not familiar with the subject.