One to one function means each y- value is paired with exactly one x value. So when you are encoding a function and a one to one relationship exists then only, it would allow you to decode correctly. If one to one relationship does not exist you will not be able to decode correctly.
For example tan 45 =1. If tan 45 had more than one value you will not be able to say tan inverse of 1 is 45 degrees.