Is the inverse of a function always a function?

no

e.g. suppose y = x^2 , which is a function
the inverse is x = y^2 , which is not a function

www.wolframalpha.com/input/?i=plot+y+%3D+x%5E2+,++x+%3D+y%5E2