Can a function be applied to itself?
The answer is no, if the axiom of foundation is accepted as part of set theory. (If it isn't, then this question possibly becomes much more difficult and interesting, and too difficult for me.)
For assume we have a pair $(f,y)$ that belongs to $f$. We have $(f,y) = \{ \{f\},\{f,y\} \}$ Then:
$$f \in \{ f \} \in (f,y) \in f$$
Thus the nonempty set $C = \{ f, \{f\}, (f,y) \}$ doesn't have an $\in$-minimal element. That is, there is no element $x$ of $C$ such that $x \cap C = \emptyset$. This contradicts the axiom of foundation.
As several people have pointed out, this is impossible when we view a function as a "set of ordered pairs". But, if we view a function instead as an algorithm, then it is perfectly possible. For example, I can write a python program that takes a string of characters as input and returns the number of characters in the string. I can then apply this program to itself to determine how many characters it has.
This concept is pushed to the limit in functional programming languages such as Scheme and in the untyped $\lambda$ calculus. These languages eliminate the difference between "code" and "data".
One challenge in finding semantic models for these languages is the set theoretic difficulties mentioned above. But there are, in fact, semantic models for these languages. This is what user322483 referred to in his or her answer.
Yes, see http://en.wikipedia.org/wiki/Domain_theory .
It will not work for the set theoretic definition of a function $f: A\to B \in B^A$ since $B^A \cap A = \emptyset$ when constructed in the category $\cal Set$. This construction is possible in the category of domains, though.