The function exchanges the first and last characters of a string if they are alphabets.

[CODE]: 
```python
def custom_function(s):
    if s[0].isalpha() and s[-1].isalpha():
        return s[-1] + s[1:-1] + s[0]
    else:
        return s
```