Is R[x] a ring of functions or a ring of expressions? I know that these two notions are isomorphic, but for a ring $R$, is $R[x]$ a ring of functions (e.g. $f:x\mapsto x^3+1$) or a ring of expressions (e.g. $f(x)=x^3+1$). If it were the former, the variable $x$ would be meaningless and $R[x]=R[y]$, but if it were the latter, $x$ would be important and $R[x] \cong R[y]$ (isomorphic), but $R[x]\neq R[y]$.
 A: The rigorous answer is "neither". The polynomial ring is the set of all sequences of elements of $R$ that have only finitely many nonzero elements. More precisely, it is a wrapper class over the set of such sequences, providing notions of addition and multiplication and, optionally, a name for the "variable" (so that, as @DietrichBurde pointed out, we can distinguish between the two polynomial rings $R\left[x\right]$ and $R\left[y\right]$, despite both being made of the same underlying sequences). Both "functions" and "expressions" are intuitive approximations that are often helpful but that have their limits.
Why are functions insufficient? For many reasons. Here are three:

*

*You want to be able to apply your polynomials not just to elements of your ring $R$, but also to square matrices over $R$ (of arbitrary size!), and more generally to elements of any $R$-algebra. If they were functions, then their domain would have to contain all these objects. This is not just clumsy, but also logically impossible, because the domain of your polynomials would have to contain the very same polynomials (because the polynomials themselves are elements of an $R$-algebra), and that would be self-referential.


*You may fix this by defining polynomials as functions with a "flexible" domain (i.e., a domain that can be extended at will). Indeed, such "functions" are known as natural transformations. But natural transformations aren't very easy to work with. In particular, there is no way to tell when two natural transformations are equal, short of having a "test object" on which to compare their concrete avatars. How do you find such a "test object" for polynomials? It's no easier than to define polynomials as sequences.


*You want to be able to compare coefficients in your polynomials. In other words, you want to have a theorem saying "if $a_0 + a_1 X + a_2 X^2 + \cdots = b_0 + b_1 X + b_2 X^2 + \cdots$ as polynomials, then $a_i = b_i$ for all $i$". If you define polynomials as functions, then this is either false (e.g., if the domain of your functions is $R$ and $R$ is a finite field) or requires the domain to be chosen in a way that is no easier than defining polynomials differently.
Why are expressions insufficient? Because the word "expression" is not defined unambiguously. Do $1 + 2x$ and $2x + 1$ count as the same expression? Do $1 + 4x$ and $1 + \left(2\cdot 2\right)x$ ? Do $x^2 - x$ and $0$ when $R = \mathbb{Z}/2$ ? Why, and why not? Once you have crystallized the right notion of "expression", you will probably end up with a definition that is either equivalent to the "sequence" definition or much harder to use than the latter.
Let me expand on the "name" part. You can define polynomials in $R\left[x\right]$ as sequences $\left(a_0,a_1,a_2,\ldots\right) \in R^\infty$ such that only finitely many $i$ satisfy $a_i \neq 0$. Then, you can define $x$ to be the sequence $\left(0,1,0,0,0,\ldots\right)$. This works great as long as you are working in one variable. But when you construct a polynomial ring over a polynomial ring, you obtain two different objects both called $x$. This problem can be addressed in several ways, but the simplest one is to make the name of the indeterminate (i.e., of the sequence $\left(0,1,0,0,0,\ldots\right)$) customizable (so you don't have to call it $x$). This name is tacked onto your sequences as a "tag", so the polynomials $x = \left(0,1,0,0,0,\ldots\right)_{\text{tag } x}$ and $y = \left(0,1,0,0,0,\ldots\right)_{\text{tag } y}$ are considered different.
Let me expand on the "wrapper class" part. This is a purely notational technicality, but since we're talking about technicalities here, I thought it should be said. Let me illustrate it on a simpler example. It is common to define the complex numbers as pairs $\left(a,b\right)$ of real numbers, with multiplication defined by $\left(a,b\right)\left(c,d\right) = \left(ac-bd,ad+bc\right)$ (and addition defined entrywise, but this doesn't matter for us here). It is also common to define the dual numbers as pairs $\left(a,b\right)$ of real numbers, with multiplication defined by $\left(a,b\right)\left(c,d\right) = \left(ac,ad+bc\right)$ (and addition defined entrywise, but this doesn't matter for us here). But if you make both definitions, then you create an ambiguity: Given two pairs $\left(a,b\right)$ and $\left(c,d\right)$ of real numbers, there are now two different definitions of the product $\left(a,b\right)\left(c,d\right)$ of these two pairs. To resolve this ambiguity, you define the complex numbers not as the "naked" pairs $\left(a,b\right)$ but rather as a "wrapper object" over these kinds of pairs which carries the additional information that they are complex numbers. Likewise, you define the dual numbers not as "naked" pairs, but as pairs with the "dual number" tag tacked on them. Now, you never have to define the product of two "naked" pairs, but only the product of two complex numbers and the product of two dual numbers; and these definitions don't conflict with each other, since each only applies to pairs with the right tag. Something similar needs to be done for polynomials as soon as you have two different notions that both define a multiplication on infinite sequences. (This is a basic idea of computer science.)
A: It's the latter, and the distinction is rather important.
For example, in $\mathbb F_2[x]$, the polynomials $x$ and $x^2$ are different, but the corresponding function is the same in both cases.
A: The polynomial algebra over $R$ is what's known as a "free object in the category of (commutative) $R$-algebras." That means that $R[x]$ is the unique $R$-algebra such that for any other $R$-algebra $S$ and any element $a$ of $S$ there is a unique map from $R[x]$ to $S$ taking $x$ to $a$.
What this means is that $R[x]$ consists of functions. But these are not functions $R \to R$, they are what we might call "universal functions." That is, for any $R$-algebra $S$, an element $f \in R[x]$ gives a function $f : S \to S$. Two elements of $R[x]$ are equal if and only if they determine the same functions $S \to S$ for every $S$.
For example, let $R = \mathbf{Z}/3\mathbf{Z}$ and $f = x^3 - x \in R[x]$. Then the function $f : R \to R$ equals the zero function. On the other hand, if we take $S = R[i]$ (where $i^2 = -1$) then $f : S \to S$ does not equal the zero function because $i^3 - i \ne 0$. Thus $f \ne 0$ in $R[x]$ because there exists some $R$-algebra $S$ (namely $R[i]$) for which $f : S \to S$ is not the zero function.
Two polynomials, defined naïvely, are equal if and only if their respective coefficients are equal. To make this precise, we define $R[x]$ to be the set of sequences of coefficients with the appropriate addition and multiplication and show that this ring satisfies the "universal function" property of a free object. One key step of the proof is to consider $f : S \to S$ where $S = R[x]$.
A: It's the latter, at least that's the notation I am used to (but I am more on the algebra side of math).
