Consider the function y = x2
This doesn't have an inverse (in the real number domain) because there isn't a unique value of x for a given y, but by writing x = y2 before doing anything else you imply there is (to qualify as a function an expression must map an input to a unique output).
However, as you say, the important thing is being careful about the restrictions. As long as you keep this in mind I will not say you can't do it Melody!
.