Give an example of a function (i) Which is one-one but not onto. (ii) Which is not one-one but onto. (iii) Which is neither one-one nor onto.
Give an example of a function (i) Which is one-one but not onto. (ii) Which is not one-one but onto. (iii) Which is neither one-one nor onto.

(i)Let f: Z → Z given by f(x) =

    \[3x~+\text{ }2\]

Let us check one-one condition on f(x) =

    \[3x~+\text{ }2\]

Injectivity:

Let x and y be any two elements in the domain (Z), such that f(x) = f(y).

f (x) = f(y)

    \[3x~+\text{ }2\text{ }=3y~+\text{ }2\]

⇒ 

    \[3x~=\text{ }3y\]

⇒ x = y

⇒ f(x) = f(y)

⇒ x = y

So, f is one-one.

Surjectivity:

Let y be any element in the co-domain (Z), such that f(x) = y for some element x in Z(domain).

Let f(x) = y

    \[3x~+\text{ }2\text{ }=~y\]

⇒ 

    \[3x~=~y~\text{ }2\]

⇒ 

    \[x\text{ }=~\left( y\text{ }\text{ }2 \right)/3\]

. It may not be in the domain (Z)

Because if we take y = 

    \[3\]

,

    \[x\text{ }=\text{ }\left( y\text{ }\text{ }2 \right)/3\text{ }=\text{ }\left( 3-2 \right)/3\text{ }=\text{ }1/3\notin ~\]

domain Z.

So, for every element in the co domain there need not be any element in the domain such that f(x) = y.

Thus, f is not onto.

(ii) Example for the function which is not one-one but onto

Let

    \[f:~Z~\to ~N~\cup \left\{ 0 \right\}\]

given by 

    \[f\left( x \right)\text{ }=\text{ }\left| x \right|\]

Injectivity:

Let x and y be any two elements in the domain (Z),

Such that f(x) = f(y).

    \[\Rightarrow \left| x \right|\text{ }=\text{ }\left| y \right|\]

⇒ 

    \[x\text{ }=~\pm \text{ }y\]

So, different elements of domain f may give the same image.

So, f is not one-one.

Surjectivity:

Let y be any element in the co domain (Z), such that f(x) = y for some element x in Z (domain).

f(x) = y

    \[\Rightarrow \left| x \right|\text{ }=~y\]

    \[x\text{ }=~\pm \text{ }y\]

Which is an element in Z (domain).

So, for every element in the co-domain, there exists a pre-image in the domain.

Thus, f is onto.

(iii) Example for the function which is neither one-one nor onto.

Let f: Z → Z given by f(x) =

    \[2{{x}^{2}}~+\text{ }1\]

Injectivity:

Let x and y be any two elements in the domain (Z), such that f(x) = f(y).

f(x) = f(y)

⇒ 

    \[2{{x}^{2}}+1~=~2{{y}^{2}}+1\]

⇒ 

    \[2{{x}^{2}}~=~2{{y}^{2}}\]

⇒ 

    \[{{x}^{2~}}=~{{y}^{2}}\]

⇒ 

    \[x\text{ }=~\pm \text{ }y\]

So, different elements of domain f may give the same image.

Thus, f is not one-one.

Surjectivity:

Let y be any element in the co-domain (Z), such that f(x) = y for some element x in Z (domain).

f (x) = y

⇒ 

    \[2{{x}^{2}}+1=y\]

⇒ 

    \[2{{x}^{2}}=~y~-~1\]

⇒ 

    \[{{x}^{2}}~=\text{ }\left( y-1 \right)/2\]

⇒ 

    \[x\text{ }=\text{ }\sqrt{\left( \left( y-1 \right)/2 \right)~}\notin Z\]

always.

For example, if we take, y = 

    \[4\]

,

    \[x\text{ }=\text{ }\pm \text{ }\sqrt{\left( \left( y-1 \right)/2 \right)}\]

=

    \[\pm \text{  }\sqrt{\left( \left( 4-1 \right)/2 \right)}\]

=

    \[\pm \text{ }\sqrt{\left( 3/2 \right)}\notin Z\]

So, x may not be in Z (domain).

Thus, f is not onto.