Nullhomotopic Mappings and Contractible Spaces

I am having problems proving this fact. A space X is contractible if and only if
every map f:X to Y (Y is arbitrary) is nullhomotopic. Similarly show X is contractible
iff ever map f:Y to X is nullhomotopic.

In the first case if Y=X then see that the identity map on X is nullhomotopic. But Im not
sure how to proceed for the rest.

© SolutionLibrary Inc. 9836dcf9d7