# Basic one to one and onto proof.

I am trying to understand 1-1 and onto. I want to do this by attempting to prove that a function $f: \mathbb{R} \rightarrow \mathbb{R}$ defined by $x^3 +2$ is 1-1 and onto.

My attempt:

To prove that a function is $1$-$1$, we can show that if two elements in the domain can be mapped to the same element in the co-domain, then they are the same element.

The domain and co-domain for this example are the same ($\mathbb{R}$).

Suppose $x$ and $y$ are real numbers and suppose that $f(x)=f(y)$. We need to show that $x=y$. Since we said $f(x)=f(y)$:

$$x^3+2 = y^3+2$$ $$x^{1/3} = y^{1/3}$$ $$\pm x=\pm y$$ $$x=y$$ $$\Rightarrow \text{one-to-one}$$

To prove a function is onto, we need to show that for every real number $y$, there exists a real number $x$ such that $f(x)=y$. Let $x= (y-2)^{1/3}$, now $f(x)=(y-2)^{(1/3)(3)}+2=y-2+2=y \Rightarrow \text{onto}$.

My first question: Is my proof right?

My second question: Is there a way to just know (by intuition, or maybe graphically) that it's obvious that such function is one-to-one and onto?