The following definition of topological embeddings is given in Introduction to Topological Manifolds by John M. Lee.
Definition. An injective continuous map that is a homeomorphism onto its image (in the subspace topology) is called a topological embedding.
In defining topological embeddings, is it necessary to first suppose a function is injective and continuous? Is there such a function $f:X\to Y$ that is not injective or continuous, but the function $\tilde{f}:X\to f(X)$ is a homeomorphism?
The requirement $f:X\to Y$ be injective and continuous seems redundant to me, for if the function $\tilde{f}:X\to\ f(X)$ obtained by restricting the codomain of $f$ to its range is a homeomorphism, then it automatically guarantees $f$ is continuous and injective. In short, why not define a topological embedding as follows?
Definition. A map $f:X\to Y$ between topological spaces is called a topological embedding if the function $\tilde{f}:X\to\ f(X)$ obtained by restricting the range of $f$ is a homeomorphism.