This sort of counting argument can be quite tricky, or at least inelegant, especially for large sets. Here's one approach:
There's a bijection between equivalence relations on $S$ and the number of partitions on that set. Since $\{1,2,3,4\}$ has 4 elements, we just need to know how many partitions there are of 4.
There are five integer partitions of 4:
- $4$,
- $3+1$,
- $2+2$,
- $2+1+1$,
- $1+1+1+1$
So we just need to calculate the number of ways of placing the four elements of our set into these sized bins.
4
There is just one way to put four elements into a bin of size 4. This represents the situation where there is just one equivalence class (containing everything), so that the equivalence relation is the total relationship: everything is related to everything.
3+1
There are four ways to assign the four elements into one bin of size 3 and one of size 1. The corresponding equivalence relationships are those where one element is related only to itself, and the others are all related to each other. There are clearly 4 ways to choose that distinguished element.
2+2
There are $\pmatrix{4\\2}/2=6/2=3$ ways. The equivalence relations we are looking at here are those where two of the elements are related to each other, and the other two are related to themselves. So, start by picking an element, say 1. Then there are three things that 1 could be related to. Once that element has been chosen, the equivalence relation is completely determined.
2+1+1
There are $\pmatrix{4\\2}=6$ ways.
1+1+1+1
Just one way. This is the identity equivalence relationship.
Thus, there are, in total 1+4+3+6+1=15 partitions on $\{1,2,3,4\}$, and thus 15 equivalence relations.