Why does the word si have at least two separate meanings? How did it come to acquire them?
Si "if" is from Latin sī "if". Straightforward enough.
Si "so", "so much", and even "yes" is from Latin sīc "in that way". A vestige of that older meaning can be seen in the French ainsi "in that way", originally a compound in + si.
The connection between "in that way" (or "thus") and the other two meanings, "yes" and "so much", is linguistically interesting and not a phenomenon unique to French. An intuitive look at conversations involving these words gives an idea of why these concepts are related.
Note: This isn't to deny that French might have borrowed alternate meanings from other languages. I'm not trying to figure out in which language or at which stage the expansion of meanings took place — it just matters that they took place somewhere along the line.
For the connection between "thus" and "yes", the mere fact of restating something is often taken as an affirmation. In fact, some languages don't even have a word for "yes". In Ancient Hebrew, for example, to indicate that what someone said was correct, one repeated a key word from their utterance.
The reply in this passage (and many like it) is generally translated "Yes" in English:
Ahab said to Elijah, "Have you found me, my enemy?" He said, "I have found."
(1 Kings 21:20a, literal translation)
Now consider an exchange like this:
— "N'est-ce pas qu'elle est belle ?" Isn't she beautiful?
[Etymological meaning] Thus. / As (you've said).
[Modern meaning] Yes.
In a pragmatic analysis, you might say that we understand repetition as affirmation simply because there isn't another reason why the person would repeat the utterance. Actually, even in English, I often hear someone repeat the last couple of words the previous speaker said to signal their agreement.
Interestingly enough, in standard French, the affirmative meaning of si replaces the "in that way" aspect to the point of rejecting a statement in the negative!
— "Tu n'es jamais allé en France ?" You've never been to France?
— "Mais si !" In fact I have!
As for the other overlap between "thus" and "so much", it likely has a similar development: stressing the particular nature of an object or manner in which an action was done serves as intensification. This is also true of tel and tellement:
On ne mange pas une telle chèvre. One doesn't eat a goat that is like that.
Jamais je n'ai vu une telle chèvre ! I've never seen such a goat!
In the second sentence, "such a goat" seems to imply that the goat is extraordinary in some aspect. Perhaps it's even more omnivorous than most. But the connection becomes clearer when you see that the derived word tellement has more or less only retained the intensifying sense:
Cette chèvre est tellement belle ! That goat is so beautiful!
And in fact, as Laure points out, the same development took place in English; a certain usage of "so" carries the meaning "as, in that way, thus":
Make it so.
If you don't do it just so, it won't work.
Oh, he's a li'l feller about so high (gestures).
This has evolved into mere intensification:
That goat is so beautiful!
Perhaps, to cite pragmatics again, it's because an unqualified "thus" offers little other interpretation. Vague usage, which qualifies a great deal of excited human speech, often leads to the blurring or slipping of definitions. In fact, "that" in the sense of "to that degree" is yet another example:
Oh, it's not that cold out.
How cold? It doesn't matter exactly. All that counts is that its mention implies that it's noteworthy, which likely means on the extreme end of the spectrum.
Incidentally, the field of semantics covers some interesting research on parallel developments in different languages. What comes to mind right now is the non-academic book Studies in Words by C.S. Lewis. He looks at a few languages and observes that in each of them, "wit" and "villainy" seem to overlap ("craftiness"), as do "perception" and "judgement" ("sense"), and likewise "the natural world" and "everything" ("nature"). The reason I bring it up is because certain concepts are naturally related in human experience, even if we aren't always consciously thinking of the relation, and hence you get words with surprisingly consistent polysemy.
It seems like 'si' use as yes comes from neighbouring European countries. I live in canada, where there's been a french population for over 400 years and I've only heard European French people saying this.
In most cases, "si" means if, but like Justin said, it can also be used to mean "yes", but only to answer a question that was asked in a negative form. For example: "Tu n'as pas mangé? Si, j'ai pris un sandwich sur la route." vs. "Tu as mangé? Oui, un sandwich sur la route".