NMOS small signal high frequency
By unity gain, it means the output current is equal to the input current.

The input current expression comes from solving V=IZ for I and substituting the impedance of the capacitor (1/sC) for Z. Then you can factor out the common terms (s and Vgs) to get the expression your book has.

You get the final expression by equating input and output current, and solving for frequency (s= jw for the case of steady state AC input).