may I have a small hint for this question?
imgur.com/a/APIt0gQ , so far I have gathered that since $\pi_1(X)$ is abelian, if $f$ is not null-homotopic, then $f_{\ast}(\pi_1(X,x_0))$ is a non-trivial abelian subgroup of $\pi_1(Y,y_0)$, and the latter is a free group, so this must be $\mathbb{Z}$