What is one one and onto function? Explain with example

What is one one and onto function? Explain with example

for x1 ≠ x2 or f(x2) ≠ f(x2)
3x2 ≠ 3x2
3x2 + 2 ≠ 3x2 + 2
f(x2) ≠ f(x2)
Therefore, f is one-one.
3x2 + 2 = 3x2 + 2
3x2 = 3x2
x2 = x2
Therefore, f is one-one