Exercise I-2 in "The Geometry of Schemes" by Eisenbud and Harris From the book:
Each element f ∈ R defines a “function”, which we also write as f, on the
space Spec R: if x = [p] ∈ Spec R, we denote by κ(x) or κ(p) the quotient
field of the integral domain R/p, called the residue field of X at x, and we
define f(x) ∈ κ(x) to be the image of f via the canonical maps
R → R/p → κ(x).
Exercise I-2. What is the value of the “function” 15 at the point (7) ∈
Spec Z? At the point (5)?
I am unclear on what they mean by "function" here. Can someone explain what f is? Is it a regular function? What are the answers to to exercise I-2 (maybe that will help).  
 A: Let $X = \operatorname{Spec} R$, and $f \in R$.  Then you can think of $f$ as a function from $X$ into the disjoint union of the $\kappa(\mathfrak p) = \operatorname{Quot}(R/\mathfrak p) : \mathfrak p \in X$, given by
$$f(\mathfrak p) := f + \mathfrak p \in R/\mathfrak p \subseteq \kappa(\mathfrak p)$$
where $f+\mathfrak p$ is the image of $f$ under the homomorphism $R \rightarrow R/\mathfrak p$.   In function notation 
$$f: X \rightarrow \coprod\limits_{\mathfrak p \in X} \kappa(\mathfrak p)$$ where the upside down product means disjoint union.
It's a bit confusing because each value $f(\mathfrak p)$ lives in a different field.
This is a generalization of the classical situation, where $X = \operatorname{m-Spec}(R)$ for $R$ a finitely generated algebra over an algebraically closed field $k$.  Then each quotient $R/\mathfrak p$ for $\mathfrak p \in X$ is canonically isomorphic to $k$, so for $f \in R$, the procedure above lets you think of $f$ as simply a $k$-valued function.
In your case, where $R = \mathbb{Z}$, any integer $a$ can be identified with a function
$$a: \operatorname{Spec} \mathbb{Z} \rightarrow \mathbb{Q} \cup \mathbb{Z}/2\mathbb{Z} \cup \mathbb{Z}/3\mathbb{Z} \cup \mathbb{Z}/5\mathbb{Z} \cup \cdots$$
where:
$$a( (0)) = a \in \mathbb{Q}$$
$$a(2\mathbb{Z}) = a + 2\mathbb{Z} \in \mathbb{Z}/2\mathbb{Z}$$
$$a(3\mathbb{Z}) = a + 3\mathbb{Z} \in \mathbb{Z}/3\mathbb{Z}$$
$$a(5\mathbb{Z}) = a + 5\mathbb{Z} \in \mathbb{Z}/5\mathbb{Z}$$
and so on.
What's also confusing is that different elements of $R$ may give rise to the same function $\operatorname{Spec} R \rightarrow \coprod\limits_{\mathfrak p } \kappa(\mathfrak p)$.  The correspondence is injective if and only if $R$ is a reduced ring.  Hope this helps.
