How to prove $a = c$ if $a = b$ and $b = c$? It seems like a simple question, but is actually quite hard to prove. You don't just simply say:

$a = c$ because $a = b$ and $b = c$.

Like I actually want a proof behind it, something like using formulae, arithmetic, etc.
How is this possible?
 A: I'd just like to point out that at least in ZF set theory, a current standard foundation for mathematics, equality is defined in terms of membership and simple logic, so this becomes a theorem.
Definition: 

$$A = B \iff (x \in A \iff x \in B)$$

Theorem (Transitivty of Equality):

$$(A = B \wedge B = C) \implies A = C$$

Proof:
Suppose:
$$A = B \wedge B = C$$
Applying the definition of equality:
$$(x \in A \iff x \in B) \wedge (x \in B \iff x \in C)$$
By transitivity of logical equivalence (which I believe is a theorem of elementary logic):
$$(x \in A \iff x \in C)$$
Which by definition is,
$$A = C$$
A: In any part of mathematics where one uses equality (and I can't think of any parts where one doesn't) one admits as axioms those that express that equality is an equivalence relation. This means that you can always assume that


*

*For any value $x$ one has $x=x$,

*Whenever $x=y$ then also $y=x$,

*Whenever $x=y$ and $y=z$ then also $x=z$.


The question you ask is the third axiom, so you can use this without needing to prove it.
Any notion of "equality" that does not satisfy these axioms should not be denoted by "$=$", as this would immediately invite erroneous arguments that do use the above properties. An example of such a relation is "approximately equal" among (for instance) real numbers, formulated using any reasonable precise definition you like.
A: This is the transitive property.  Many relations depend on the transitive property, such as partial order relations and equivalence relations.   You can read more about relations here http://en.wikipedia.org/wiki/Binary_relation  or for example, Munkres Topology gives a nice little introduction good enough for many practical purposes.
