One way hashes make it possible for f() = x == y, x contains y etc (although now the owner of x knows y and vice-versa, does this count?)
Technically functions which discard information like abs(x) + abs(y) can also work, as you can send x or -x and get the same result, the attacker would have have to make 4 guesses. But I'm not sure how secure this would be considered?
A generic solution for any f is impossible as shown by f() = x
It sounds like the general class of functions you might be able to make it work for would be cryptographic functions themselves