See in a Inverter ( NOT gate ) if you apply input a then get a'.
Now in a 3 Input Nand Gate , ( 3 input are applied at AND gate ) , so here if you apply just one input say s ,
Let all the 3 input lines be A , B and C
now if you are just applying one signal s . Then apply this signal on all the input line
So A=s
B =s
C=s
We know that NAND gate is nothing (AND + NOT )
SO AND will give (s.s.s.) = s , followed by NOT will give s'
Hence this is how 3 input AND gate can act as inverter . You can even check with 2 signal x and y. :)