Doubt in a question related to ring homomorphism Problem
Determine all ring homomorphism from
$\mathbb{Q}$ to $\mathbb{Q}$ 
Attempt
Let $\phi$ be a ring homomorphism .
$\phi$ can take 1 either to 0 or 1. So there are two maps :one identity and another zero
Doubt
In some books criterion for existence of ring homomorphism it is necessary that $\phi(1)$ takes 1 to 1. I think 1 should go to an idempotent. 
Please anyone clarify
 A: I assume your notion of ring homomorphism does not require to map $1$ into $1$, even if the rings involved have an identity.
Suppose $f\colon R\to S$ is a ring homomorphism and that $R$ has an identity $1$. Then
$$
f(1)=f(1^2)=f(1)^2
$$
so $e=f(1)$ is an idempotent.
In the case of $S=\mathbb{Q}$, the only idempotents are $0$ and $1$. Thus a homomorphism $f\colon\mathbb{Q}\to\mathbb{Q}$ satisfies either $f(1)=0$ or $f(1)=1$.
In the first case $f(x)=0$ for all $x$. In the latter case it's easy to prove that $f$ is the identity. Indeed, it must map integers to themselves (proof?), and
$$
1=f\left(\frac{n}{n}\right)=nf\left(\frac{1}{n}\right)
$$
implying that $f(1/n)=1/n$ and we easily finish up the proof that $f$ is the identity.
Similarly if $S$ is an integral domain: an idempotent $e$ satisfies $e(1-e)=0$, so either $e=0$ or $e=1$. Thus a homomorphism $f\colon R\to S$ (where also $R$ has an identity) is either the zero map or a homomorphism carrying $1$ into $1$. For nondomains this can be false, a simple example is
$$
f\colon\mathbb{Z}\to\mathbb{Z}\times\mathbb{Z},\qquad f(x)=(x,0)
$$
