Could infinity be represented as a recursive function like:
The function f takes any number x as parameter and returns f(x+1), resulting in an endless recursive call, each call incrementing x by 1. Logically, the answer of the initial function call would never be returned, but because in a theoretical sense, the calls would happen instantly, then could one say that f(x) = ∞, where f returns a call to itself with x+1? thanks.
Concretely, you seem to be asking what function(s) satisfy the functional equation $f(x) = f(x+1)$. To make that question precise, you would need to specify the desired domain and range of the function $f$. One choice you might have in mind is that $f$ should be defined on the positive integers and take on positive integer values. In such a case, choose any value $n$ for $f(1)$. Then by the functional equation, $f(2) = f(1) = n$, and $f(3) = f(2) = n$, and so on by induction, $f(m) = n$ for all positive integers $m$. That is, $f$ will be a constant function, and so we have shown (for this particular domain and range) that the collection of all $f$ satisfying the given functional equation are all the constant functions. You won't find $\infty$ as a value of any of these functions, simply because the range we considered did not contain any element "$\infty$". So to try to get at your larger question, no, I would not characterize this scheme as a method of "generating" infinity, whatever that might mean.
For anyone to be able to give a more specific answer to your initial question, you would need to specify more exactly what you might mean by the vague language of a function "representing" infinity? Represent in what way?