Some kind of “bijection” between $\mathbb R$ and $\mathbb N$

The problem is: prove the existence of function $f: \mathbb{R}\times\mathbb{R} \rightarrow \mathbb{N}$ such that $f(x,y)=f(y,z)\implies x=y=z$. I was thinking about $f(x,y) = \left\{ \begin{array}{ll} 1 & \textrm{iff$x=y$}\\ something & \textrm{ iff$x\neq y$} \end{array} \right.$ but I guess we need to have bijection from $\mathbb{N}$ to $\mathbb{R}$ to do that, which don't exist because $|\mathbb{N}| < |\mathbb{R}|$. EDIT: let's make it clear. If we take some $c \neq g$, $f(c,c)$ can't be equal to $f(g,g)$.

• @pingwindyktator I don't understand how your edit follows from the question. If it does, the question is easy (just count the possible values of $f(a, a)$), but I think showing this is hard. – Noah Schweber Jan 18 '16 at 19:16
• Haven't you proven it is impossible? if $x,y \in R; x \ne y$ then $f(x,x) \ne f(y,y)$. So g(x) = f(x,x) f: R -> N is an injective function. Which is impossible. So such a function can't exist? At least I think so. I could have made a careless error. – fleablood Jan 18 '16 at 19:19
• @fleablood The OP's edit is at odds with their actual question . . . – Noah Schweber Jan 18 '16 at 19:22