The rule applied by the function f(x) is that if the input word contains the letter "w" or "W", the output is "wolf", otherwise the output is "bear".

