Take f[x] = { 2 x if x > 0 and -2 x if x <= 0 } .
Make a plot of f[x]. Discuss whether [Graphics:LimitsBasicsgr130.gif] f[x], [Graphics:LimitsBasicsgr131.gif] f[x], and [Graphics:LimitsBasicsgr132.gif] f[x] exist. Explain why or why not for each limit.

Answer:

Clear[f]
f[x_]:= If[x > 0, 2x, -2x]

A Mathematica note---When we have a piecewise defined function, we use the If command to define it. In the statement:
f[x_]:= If[x > 0, 2x, -2x]
the first entry, x > 0, tells Mathematica to first decide if a given x-value is greater than 0. If x > 0, then we use the second entry in the If command to find f[x]. If x is not greater than 0 (i.e., x <= 0), then we use the third entry in the If command to define f[x]. Here is f[0.1]:

f[0.1]
[Graphics:LimitsBasicsgr2.gif][Graphics:LimitsBasicsgr133.gif]

And here is f[-0.1]:

f[-0.1]
[Graphics:LimitsBasicsgr2.gif][Graphics:LimitsBasicsgr134.gif]

Here is the plot of f[x]:

Plot[f[x],{x,-3,3}]
[Graphics:LimitsBasicsgr2.gif][Graphics:LimitsBasicsgr135.gif]
[Graphics:LimitsBasicsgr2.gif][Graphics:LimitsBasicsgr136.gif]

In this example it is clear that the limit from below is 0, as is the limit from above. Thus the limit from both sides is also 0.
We can write [Graphics:LimitsBasicsgr137.gif] f[x] = [Graphics:LimitsBasicsgr138.gif] f[x] = [Graphics:LimitsBasicsgr139.gif] f[x] = 0.