Consider to Groups $G$ and $H$ such that:
The only two endo-hom omorphisms (homomorphisms from a group to itself) that are idempotent (any function $f$ such that $f(f(x))=f(x)$ for all x) are the maps that send each group element to itself, and the map that sends each element to the identity.
For any other group $F$ (except the trivial group), there is a map from the group to $F$, such that not all the elements are mapped to $F$'s identity element.
Then $G$ and $H$ are isomorphic. Is this true?
On thing to notice is that $\mathbb{Z}$ satisfies this. Namely, if $F$ is a non trivial group, then it has a nonidentity element, a there is a map $f$ such that $f(1)=z$ for some nonidentity $z$ of $F$. Also note that the only endomorphisms on $\mathbb{Z}$ are multiplication by integers, and the only two integers such that $n^2=n$ are $0$ (which would create the map sending each element to the identity) and $1$ (which would create the element sending each element to itself.) Therefore the question above could be phrased by saying whether $G$ and $H$ must be isomorphic to $\mathbb{Z}$.
The motivation for this question is to see whether $\mathbb{Z}$ can be uniquely identified (up to isomorphism) based only on its homomorphisms.