The function f(x) returns the original string if the string contains only alphanumeric characters. Otherwise, it replaces all non-alphanumeric characters with the letter 'z' and returns the modified string.

[CODE]:
```
def f(x):
    import re
    if re.match(r'^[a-zA-Z0-9]+$', x):
        return x
    else:
        return re.sub(r'[^a-zA-Z0-9]', 'z', x)
```

This code snippet uses regular expressions to check if the input string consists of only alphanumeric characters. If it does, the function returns the original string. Otherwise, it uses `re.sub()` to replace all non-alphanumeric characters with the letter 'z' and returns the modified string.