Let $R$ be a commutative ring with $1\not =0$, and let $D\ni 1$ be a multiplicative subset of $R$. Consider the universal characterization of $D^{-1}R$:
Universal property of localization is well known.
There is a morphism $\pi\colon R\to D^{-1}R$ such that for all rings and morphisms $\psi\colon R\to S$ satisfying
$\psi(D)\subset S^{\times}$
there is a unique morphism $\Psi\colon D^{-1}R\to S$ such that $\Psi\circ\pi=\psi$.
In the case we don't assume the condition $\psi(D)\subset S^{\times}$, what is the counterexample of the statement ?
Thank you in advance.
For any ring map, units map to units.
If you have a map $\psi\colon R\to S$ such that $\psi(D)$ is not mapped into the units of $S$, then you cannot possibly have a diagram $\psi = \Psi\circ\pi$, since $\pi(D)$ consists of units, and hence $\Psi(\pi(D))=\psi(D)$ must also consist of units.