Let \(f: \mathbb {R} \rightarrow \mathbb {R}\) . The Heaviside function H is defined by \( H(x) = {\left\{ \begin{array}{ll} 1 \quad (x > 0)\\ 0 \quad (x \le 0). \end{array}\right. } \) In this paper, we study the composite functional equation \(\begin{aligned} f(x + f(y)) = (x + f(y)) G_f (x), \end{aligned}\) where \(\begin{aligned} G_f (x) = f(H(x) + f(x) - x) + f(H(1 - x) + f(1 - x) - (1 - x)). \end{aligned}\) Define the function \(I: \mathbb {R} \rightarrow \mathbb {R}\) by setting \( I(x) = {\left\{ \begin{array}{ll} x \quad (x \in \mathbb {Z})\\ 0 \quad (x \in \mathbb {R} \setminus \mathbb {Z}). \end{array}\right. } \) We prove that \(f = I\) holds in the case \(f(1) \ne 0\) . We can regard this fact as a characterization of \(\mathbb {Z}.\)