Does there exist such an element $f\in \operatorname{Hom}_\mathbb Z(\prod_{i=1}^{\infty}\mathbb Z, \mathbb Z)$ satisfying
$f(e_k)=1$ for all $k$, where $e_k$ is the element where the $k$ th component is $1$ and other components zero.
If such an element does exist (there could be a lot of them...), then what is its full definition? i.e. $f(a_1,a_2,a_3...)$ where there could be infinitely many nonzeros?
No there isn't. Indeed let $p$ be any number $>2$ and let $x = (p^n)_n$. Then $f(x) = f(e_1) + f(0,p,p^2,...)= 1 +p f(0,1,p,p^2,...) = 1 + p + p^2 +p^3 + p^4f(...)$ by induction.
Therefore, for all $n$, $f(x) = 1+p+...+p^{n-1} \mod p^n$. Take $n$ such that $p^n > |f(x)|$, so that $f(x) = 1+...+p^{n-1}$ or $f(x)=1+...+p^{n-1}-p^n$ and look mod $p^{n+1}$ to find a contradiction.