"E.g." is the abbreviated Latin phrase "exempli gratia," and it is used in place of "for example."
"E.g." is used to introduce a set of examples, which mean it needs to be followed by the examples. It cannot be correctly used to mean "et cetera," or "etc."
Here is a correct example using "e.g.": I like most flavors of ice cream, e.g., chocolate, vanilla, raspberry.
(Notice that "e.g." is followed by a comma.)
Regarding the comma. The comma is required. For reference, take a look at #48 common bug from the writing labs at Columbia University: http://www.cs.columbia.edu/~hgs/etc/writing-bugs.html. We also see this comma espoused by style guides, e.g., the Chicago Manual of Style (CMOS) and the American Psychological Association (APA) style guides.
Regarding using "e.g." at the end of the sentence, note that I wrote that it is used to introduce examples, which means it cannot go at the end of the sentence.