Set of zero divisors and the set of units of the ring of functions from $X$ to $R$ Hope this isn't a duplicate.
I was trying to answer the following question: Let $X$ be a non-empty set and $R$ be a ring. Then define $F(X,R)$ to be the ring of functions from $X$ to $R$. Then what is the set of zero divisors and the set of units of $F(X,R)$?
My attempt:
Let $A$ and $B$ be the set of units and set of zero divisors of $R$, respectively.
Set of units of $F(X,R)$ : $\{f\in F(X,R) : f(x)\in A\;\forall x\in X\}$.
Set of zero divisors of $F(X,R)$ : $\{f\in F(X,R) : f(x)\in B\;\forall x\in X\}$.
Are the answers correct? Please suggest answers if this isn't correct.
 A: Your answer for the units of $F(X,R)$ is correct. But your answer for the zero divisors isn't.
By definition, $f\in F(X,R)$ is a zero divisor iff there exists some function $g\in F(X,R)$, $g\neq0$ (as a function!) such that $fg$ is the identically zero function, i.e. $f(x)g(x)=0$ for all $x\in X$. Note that the condition that $g$ is not the zero function does NOT preclude it from having some zero values — as long as it has at least one non-zero value, it's a non-zero function. For example, if we pick some specific $a\in X$ and $r\in R$, $r\neq0$, then the function defined as
$$g(a)=r, \quad g(x)=0 \text{ for all } x\neq a$$
is a non-zero function, isn't it? So your answer to the zero divisors question needs to be corrected, because the $\forall$ quantifier there is wrong.
A: Your answer is correct $f$ is a divisor of zero if and only if there exists a function $g$ such that $f(x)g(x)=0$ this is equivalent that the image of $f$ is contained in the set of zero divisors of $R$.
A similar argument shows that $f$ is a unit ($f(x)g(x)=1$) if and only if the image of $f$ is contained in the set of units of $R$.
