Determine whether the following function is (a) injective and (b) surjective the function is as follows: $f:\mathbb{R} \rightarrow \mathbb{Z}$ defined by $f(x) =$ the least integer greater than or equal to $x$.
here is what I have for the proof of injective:
Suppose $f(x)=f(y)$ that is,
the least integer $\geq x =$ the least integer $\geq y$
I thought that this pretty obviously implied that $x=y$.
I am unsure as to how to begin the proof of surjective. 
Can someone help?
 A: The function in question is known as the ceiling function $f(x)=\lceil x \rceil$.
To show that it is not injective, a single counterexample will do:
$$f(1.1)=f(1.3)=2\text{ and }1.1\ne1.3$$
To show that the function is surjective take $f(x)=n$ for an arbitrary $n\in\mathbb{Z}$. Then we can take $x_0=n$ (or $x_0=n-\frac{1}{2}$) so that $x_0\in\mathbb{R}$ and $f(x_0)=n$. 
A: The function you want to study is sometimes called the "ceiling function" with the notation $x\mapsto\lceil x\rceil$. It basically rounds up a real number to the closest integer greater than it. Observe that any realy number can be written as a sum of an integer and a (possibly non-repeating) fraction. As a side note, this representation may not be unique (e.g. $0.999...9...=1.000...0...$). In this sense, the function does the following:
$$a_na_{n-1}...a_{1}.a_{-1}a_{-2}...a_{-n}...\mapsto a_na_{n-1}...a_{1}.$$
For instance $f(\pi)=4, f(1/2)=1, f(5)=5, f(0.999...9...)=1$. This last example also hints at that we can disregard the multiple representation issue for the time being.
Now consider $\lceil\cdot\rceil:\mathbb{R}\to\mathbb{R}$. Note that the target space is not shrunk to integers "externally": by the definition of $\lceil\cdot\rceil$, $\lceil\cdot\rceil$ can not take a non-integer value.
If you draw the graph of $\lceil\cdot\rceil$ I believe it will be very easy to find a counterexample showing that $f$ is not injective. In fact, we have that
$$ (\star)\forall n\in\mathbb{Z}\subseteq\mathbb{R}:f(]n-1,n])=n \mbox{ (why?)}.$$
For surjectivity, you have to prove the following (generic) statement:
$$\forall t\in \mathbb{Z},\exists s\in \mathbb{R}:f(s)=t.$$
This is just a formal way of saying that any integer is attained by $f$.
As a final remark, note that it suffices to prove $(\star)$ for both the non-injectivity and surjectivity.
