If 'for example' is in the middle of the sentence, the comma preceding the phrase is necessary. But after it, it is not necessary, unless you feel it will rid the sentence of ambiguities. Generally, it will be left out and the next comma will encapsulate the whole phrase:
I could see many colours, for example red and green, (and I could...)
A semicolon needs to be used if this phrase separates two main clauses:
I showed many signs that I wanted to go home; for example, I was red in the face, and I was...
Generally however, 'for example' introduces a phrase not a clause. Thus you will rarely need or see the semicolon in this situation