In Tom Dieck’s Algebraic Topology, proposition 1.2.1 it says the following:
Let $i:Y\to X$ be an injective set map between spaces. The following are equivalent: (1) $i$ is an embedding. (2) A set map $g:Z\to Y$ from any topological space $Z$ is continuous if and only if $ig: Z\to X$ is continuous.
The author calls this proposition the “universal property of an embedding”, while I struggled to find the right categories to formulate it. I think a possible construction for the universal object in this case should be “the set of all embeddings from $X$ to $Y$”, but I cannot find any category to contain this as an object. Could anyone give an idea please?
In my opinion the concept of a universal property is too broad to fit into a rigid corset of a single abstract definiton. It certainly involves objects and morphisms of a suitable category (like categorical products and sums), but it may also require additional ingredients. In your case the essential point is that the category $\mathbf{Top}$ of topological spaces and continuous maps is introduced as a concrete category, i.e. we have a canonical faithful functor $U : \mathbf{Top} \to \mathbf{Set}$ to the category of sets and functions ($U(X) =$ underlying set of the space $X$). Roughly speaking, the objects of a concrete category are "sets with an additional structure".
So what could be the universal property of an embedding in $\mathbf{Top}$? Let us more generally consider a concrete category $(\mathbf{C}, V)$ with faithful functor $V : \mathbf{C} \to \mathbf{Set}$.
Given objects $A, B$ of $\mathbf{C}$, let us say that a morphism $\varphi : V(A) \to V(B)$ in $\mathbf{Set}$ is a morphism of $\mathbf{C}$ if $\varphi = V(f)$ with a (unique!) morphism $f : A \to B$ in $\mathbf{C}$. This is perhaps not a really legit definition, but it is certainly catchy.
A morphism $f : A \to B$ in $\mathbf{C}$ is called initial if for each object $C$ of $\mathbf{C}$ and each morphism $\gamma : V(C) \to V(A)$ in $\mathbf{Set}$ the following are equivalent:
$V(f) \circ \gamma$ is a morphism of $\mathbf{C}$.
$\gamma$ is a morphism of $\mathbf{C}$.
An initial morphism $f : A \to B$ in $\mathbf{C}$ is called an embedding if $V(f)$ is a monomorphism in $\mathbf{Set}$ (i.e. an injection).
Dualizing everything, you obtain the concept of a final (or terminal) morphism and of a quotient morphism.
For further reading see e.g.
Adámek, Jiří, Horst Herrlich, and George E. Strecker. "Abstract and concrete categories. The joy of cats." (2004).