Functions are covariant in their return types, but contravariant in arguments.
Int => Int is a subclass of Int => Any, but not of Any => Int or Any => Any (if it was, you could use in a context where, for example, a String parameter is passed in, and it would not be able to handle it, because it wants an Int).
Cosider this:
val foo: Function[Int, Int] = { x => x * x }
def bar(f: Any => Any)(arg: Any): Any = f(arg)
bar(foo)("foo") //???
The if Int => Int was a subclass of Any => Any, then the last line would be valid. But it cannot be, because it would result in foo being called with a String parameter.
Note, on the other hand, that Any => Int is a subclass of Int => Int (you can use the former anywhere the latter is required). This is what being "contravariant" means.