The rule implemented by the function f(x) seems to be mapping certain input words to specific output words. Specifically, it maps the word "Bulgaria" to "Sofia", the word "Greece" to "Athens", and the word "Mexico" to "Mexico City". 

