I have a question. Is it more productive or rigorous to think of a function as a rule that tells us how to "map" or "associate" elements from one set to another, or as a set of ordered pairs containing elements of one set (the domain) "mapped to" or "associated with" elements of another set? Or is there a context in which it makes more sense to think of a function one way vs another?
To expand on this, I've realized that I conceptualize each of the following ways of defining a function in two different ways:
$$\text{Define}\; f: X \to Y \;\;\text{by}\;\;f(x)=y$$
or
$$\text{Define the set}\; f = \{(x,f(x)) \mid x \in X\}$$
When a function is defined in the first manner, I tend to think of it as a specific "map" or "rule" that tells us exactly how to take an element from the set $X$ and associate it with a single element from the set $Y$. I tend to think of this function as an object that "completes an action" in a sense - where that action is taking an element from $X$ and mapping it to $Y$.
However, when a function is defined in the second manner, it no longer seems appropriate to think of it as something that is "completing an action". The function no longer seems like a "tool" in the sense that it does when it's defined in the previous manner. It seems as though the action is already completed. In other words, instead of viewing the function as an object that maps elements from $X$ to elements of $Y$, I tend to view the function as the result of a mapping from $X$ to $Y$.
But don't both of these ways of defining a function define the same mathematical object? I seem to be conceptualizing the same thing in two very different ways, which makes me wonder if my intuition is off.
I wondered a very similar thing when I first encountered the formal notion of a function, so I hope my perspective is helpful.
I think the reason the notation $f(x) = y$ is often associated with a 'rule' is that typically $f(x)$ is written as some combination of operations on $x$, for example $f(x) = x^2-5x+6$. I.e. there is some necessary 'computation' to be performed, and once you perform that computation, you 'know' what $f(x)$ is. In this sense, the intuition that $f$ is 'doing something' or 'acting' on $x$ is entirely natural, and I think a perfectly reasonable intuition to have.
However, I think the issue arises because of the a slight gap between the 'rule', and what the actual function is. In our above example, say we have $f(x) = x^2-5x+6$, restricting ourselves to the real numbers. Note though this 'rule' is not itself a function; rather there is an implicit understanding that this rule induces a function $f: \mathbb{R} \rightarrow \mathbb{R}$, where $f = \{(x,f(x)):x\in \mathbb{R}\} = \{(x,x^2-5x+6): x \in \mathbb{R}\}$.
In particular, I hope this addresses why you feel $f$ is "completed" in one case but not the other. I think in the former case, you are viewing the rule as the function itself, and hence, you think the function is 'doing' something to $x$. But of course, we have just seen that while implicitly related, the function and rule are indeed distinct.
In fact, we can see this in action by realising not all 'rules' will give us functions. For example, if I tell you $f(x) = \text{arcsin}(x)$, this is not a well defined function unless we appropriately specify the domain and codomain. That is to say, sometimes just giving a 'rule' is ambiguous, and it should be seen that the 'rule' is NOT the same thing as the function itself.