How do we define equality in real numbers? How do we define equality in real numbers? I know in logic we define equality by Leibniz's law.
   $$ \forall x \forall y[x=y \rightarrow \forall P(Px \leftrightarrow Py)] $$
But how do we define the set of all $P$'s for a system. For example for fractions we say $1/2$ and $2/4$ are not equal but in rational numbers they are. But it seems to me the set of all propositions that make sense about fractions and that of rational numbers are the same.
 A: You statment needs a little additional specification :

in second-order logic it is possible to define equality by Leibniz's law :

$∀x∀y[x=y→∀P(Px↔Py)]$.


In Second-order Logic we interpret the universally quantified predicate variables as meaning “for every property of objects (in the universe of discourse)”.
The semantics for second-order logic is a little bit more "complicated" than the first-order one; but if we adopt the so-called "standard semantics" [see the related chapter into SEP's entry, and compare with the chapter regarding general semantics], we have that :

A key feature of the “standard semantics” [...] is that, for a one-place predicate variable $P$, the quantifier $∀P$ ranges over the entire power set of the universe of discourse.   We have seen that this feature gives second-order languages a high degree of expressive strength.

Thus, a predicate variable is "mapped" on a subset of the domain of discourse; i.e. the meaning of the (unary) predicate variable $P$ is a "property" of the objects of the domain.
If we consider a s-o language for the structure $\mathbb Q$ of the rational numbers and want to "apply" the above definitions to the example, in order to show that :

the two fractions $1/2$ and $2/4$ are not equal

we have to find a predicate $P$ which "separates" them, i.e. such that $P$ holds for $1/2$ but does not hold for $2/4$.
I.e. we have to map $P$ into $P^* \subseteq \mathbb Q$ such that : $1/2 \in P^*$ and $2/4 \notin P^*$.
But the subset $P^*$ of $\mathbb Q$ is a set of rational numbers, and not a set of "names of numbers".
Thus, we cannot find such a $P^*$ ...
Note
Of course, assuming that when you say "the two fractions" you are speaking of the numbers... if instead you are meaning the symbols "$1/2$" and "$2/4$", of course they are different names for the same rational number (i.e. $0.5$).
But the fact that we can have more than one (in your example : two) "name" for the same object does not implies that the object "named" must be "splitted" in two.
A: First of all, this is not how equality is defined. This is a property that equality has.
In modern first-order logic equality is primitive. We don't define it, we just know that two things are equal if and only if they are the same thing. So two numbers are equal if and only if they are the same number.
For example, $0.\overline 9=1$ because both of these are in fact the same number.
So what about $\frac12$ and $\frac24$? Why are they equal? Well, recall that when we say $x=\frac ab$ we really mean that $x$ is the unique number such that $bx=a$. And so we have that: $$x=\frac12\iff 2x=1\iff 2\cdot2x=2\cdot1\iff 4x=2\iff x=\frac24$$
Therefore the two fractional representations of $\frac12$ are the same. But why does it surprise us that there are several ways of writing the same number? It shouldn't, after all, $0$ is both the unique number such that $1-1$ equals to it, as well the smallest number such that $x^2=x$, and the unique rational number $x$ such that $\sin \pi=x$.
There are many ways of writing an expression which evaluates to the same number. And that's fine. But here's the kicker: expressions are not actual numbers, they are string in the language, and whether or not two expressions are equal may (or may not) depend on the interpretation of the symbols involved in these expressions.
So perhaps a better question would be "What determines if two expressions have the same value in $\Bbb R$", but that question is vague since it doesn't specify the language, and how it might be interpreted. And in different languages we may be able to express different things (e.g. compare what you can express in the language which only includes $\leq$ and what you can express in the language which also includes $0,1,+,\cdot$ but doesn't include $\leq$).
A: This not a response as much as it is an observation regarding equality and it's meaning in mathematics that I feel is worth sharing
Consider a function described for an expression $\frac{a}{b}$ that returns $a$
Such a function would clearly differentiate between the two fractions you have presented.
Equality as we know really means "equivalent with respect to" and then a suitable definitions.
When examining an object such as a number we can ask questions about the numerical value represented or we can abstract and discuss about how this value itself is represented etc...
Just because two things are numerically equal does not mean they are textually equal.
And perfect equality is useless to us because it makes substation impossible. For example in solving $2+2-3$ the ability to say "2+2" and "4" are different yet "equivalent" in numerical value is important to us. 
