Is there a function $f(x,y)$ such that f is equal to "a" when $x>y$ and "b" when $xFirst off, I am sorry if I pose my question in a clumsy manner, as I believe I am unaware of the technical expressions.
I suppose the title requires explanation:

Simply put, I am asking whether there is a function $f(x,y)$ that indicates whether or not $x>y$, $x<y$ or $ x=y$ is true and  then returns a fixed constant ( say $a$, $b$ or $c$) value unique to each case ( i.e. in each of the 3 cases the function should return a different constant value). 

e.g. 
$f(x,y) = 0$ iff ( =if and only if) $x=y$
$f(x,y) = 1$ iff $x>y$
$f(x,y) = -1$ iff $ x<y$
I have tried several functions, but all seem to have problems. For example I tried the obvious 
$ f(x,y ) =\frac{x - y}{| x- y|}$,
which breaks down when $x=y$ and I then tried ( in an attempt to make the result at $x=y$ finite)
$ f(x,y) = e^{-\frac{x - y}{| x- y|}}$.
This has a similar problem for $\frac{x - y}{| x- y|}$ can be both positive and negative infinity,when $x = y$ or better(?) as $x$ approaches $y$.
In fact, maybe asking for the existence of such a function is a bit to broad. Apart from that, of course such a function exists, one can simply define one. So I ask, can you find such a function. Further find such a function that can be expressed using more or less simple operations ( addition, multiplication, exponentiation,...). 
Any help would be greatly appreciated. Also any pointers towards technical problems in my question, would be equally appreciated!
 A: Are you familiar with characteristic functions? Put
$$
\chi_E(x,y) = \begin{cases} 1 & (x,y)\in E \\ 0 & (x,y)\in E^c \end{cases}.
$$
The function you are looking for is
$$
f(x,y) = a\chi_{x>y}(x,y) + b\chi_{x<y}(x,y) + c\chi_{x=y}(x,y).
$$
A: The function you want is discontinuous, yet you want it written using "simple" functions or operations, which are all continuous wherever they are defined. (So their composition will be continuous wherever it is defined.)
It all hangs on which "simple" functions or operations you allow. I've already suggested $\operatorname{ceil}(x)=\lceil x \rceil$ and $\operatorname{floor}(x)=\lfloor x\rfloor$ in the comments; I've seen the other answer with the function 'signum'... That is the point: unless you allow at least one of your "simple" functions to be discontinuous, there is no solution. Once you allow one, then we can talk about how to use it for your particular purpose.
Update: You are asking whether we can do the same while restricting to only whole numbers. I think we can do the following way, to start with:
$$f(n)=\frac{2n+1}{|2n+1|}=\begin{cases}1 & n \ge 0 \\ -1 & n \lt 0\end{cases}, n\in\mathbb Z$$
Now you proceed with $\operatorname{sgn}(n)=\frac{f(n)+f(n-1)}{2}$ and then follow up as in @vadim123's answer... Or, directly put $pf(x-y)+qf(x-y-1)+r=\begin{cases} p+q+r & x\gt y \\ -p-q+r & x\lt y \\ p-q+r & x=y\end{cases}$. Then, solve: 
$$\begin{align} p+q+r & =a \\ -p-q+r & =b \\ p-q+r & =c \end{align}$$ 
to get $q=\frac{a-c}{2}$, $p=\frac{c-b}{2}$ and $r=\frac{a+b}{2}$, so the final formula is:
$$\frac{1}{2}\left[(c-b)\frac{2(x-y)+1}{|2(x-y)+1|}+(a-c)\frac{2(x-y)-1}{|2(x-y)-1|}+a+b\right]$$
