# Injectivity and bijectivity of a function

This may sound trivial but are all injective functions bijective from its domain to codomain? Obviously, not all injective functions are bijective from the domain to range but since codomain is, by definition, a set that includes all the possible values of a given function, so surjectivity is insured. Hence I think the answer to my question is yes?

From your question, I take it that codomain and range are not synonyms to you. Note that some authors/texts use range as a synonym for codomain and then image for the set of all $$y$$-values.

This may sound trivial but are all injective functions bijective from its domain to codomain? Obviously, not all injective functions are bijective from the domain to range ...

You have it the other way around, or you're confusing codomain and range (or image). The codomain can be larger than the range, so you need to limit the codomain to the range of the function to ensure surjectivity.

For example, the function

$$f: \color{blue}{\mathbb{R^+}} \to \color{red}{\mathbb{R}}: x \mapsto \sqrt{x}$$ is injective but not surjective because whenever $$y \in \color{red}{\mathbb{R}}$$ is (strictly) negative, there is no $$x \in \color{blue}{\mathbb{R^+}}$$ such that $$\sqrt{x}=y$$. The range of $$f$$ is $$\color{purple}{\mathbb{R^+}}$$ so the following function is surjective: $$f: \color{blue}{\mathbb{R^+}} \to \color{purple}{\mathbb{R^+}}: x \mapsto \sqrt{x}$$ and hence bijective.