I use Lang's Algebra book to define universal objects:
Let $\mathcal{C}$ be a category. An object $P$ of $\mathcal{C}$ is called universal attracting if there exists a unique morphism of each object of $\mathcal{C}$ into $P$, and is called universal repelling if for every object of $\mathcal{C}$ there exists a unique morphism of $P$ into this object.
This definition is simple and easy to understand. I can analyze things like a quotient group and understand its universal property. For example, Let $H$ be a normal subgroup of $G$, any homomorphism $f:G\to K$ whose kernel contains $H$ factors over $\pi: G\to G/H$. That is, there is a unique $g: G/H \to K$ such that $f=g\circ \pi$. The category of this scene has objects of all homomorphisms $f: G\to K$ whose kernel contains $H$, and has morphisms $g: K_1\mapsto K_2$ such that $g\circ f_1=g(f_1)=f_2$. And $\pi$ is the universal repelling object of this category, since for any object $f$, there is a unique morphism $g$ sending $\pi$ to $f$: $g\circ\pi=f$.
I noticed that universal properties were usually organized by wording like "For each $x\in X$, there is a unique $y\in Y$, such that some properties are held for $x$ and $y$". And I also noticed for an ordinary map $f:X\to Y$, we had a similar statement:
For each $x\in X$, there exists a unique $y\in Y$, such that $f(x)=y$.
It looks like there is some category and a universal object. So I tried to construct but failed. My attempts include treating the map as a bipartie graph with arrows from $x$ to $f(x)$, treating these vertexes as objects and arrows as morphisms. I added an extra vertex $e$, who has all other vertexes pointing to it. Then $e$ is obviously a universal attracting object, but I don't know how to relate the above "For each... there exists a unique..." statement with this construction.
Any hints are appreciated.
I think that you're confusing the objects of a category with sets, and morphisms with functions. It doesn't make sense to say "For each $x \in X$", for an object $X$ of a category $\mathscr C$, because objects do not have elements in general. Likewise, morphisms are not functions and are not applied to elements. So the statement $f(x) = y$ is not well-formed.
I think it would help if you took a look at the general statement of a universal property on Wikipedia, which makes the form of the statement clearer. Universal properties describe objects and morphisms of a category.
That said, I will mention a result that seems somewhat related. The condition you describe looks similar to the property of a binary relation being functional. It turns out that such relations do have a universal characterisation. In particular, in the bicategory of sets and relations, $\mathbf{Rel}$, the relations that are functional are precisely those that are left adjoints, which are intimately related to universal properties. (I'm glossing over some details here: really this is a more general notion of "adjoint" than an adjoint functor, but hopefully it gives you an idea of the connection.)