Answer
a. see graph below
b. range =$(-\infty,0)\cup\{2\}$
Work Step by Step
A piecewise function has a different defining expression for different intervals.
Here, both definining expressions are linear.
So, for each interval, we need two points to draw a ray (half-line).
This is why we create two tables:
Table for $x\leq 0$,
$\left[\begin{array}{ll}
x & f(x)=2x\\
-2 & -4\\
-1 & -2
\end{array}\right]$,
and draw the line up to x=0 ( including 0)
Table for $x\geq 0$
$\left[\begin{array}{ll}
x & f(x)=2\\
1 & 2\\
2 & 2
\end{array}\right]$,
and draw the line from x=0 onward (to the right)
x=0 belongs to the interval$ x\leq 0, $so $f(0)=0$
Solid circle at (0,0) - belongs to the graph
empty circle at (0,2) - does not belong to the graph
b.
Range of f
...to the left of x=0, f(x) is at most 0 ...
... to the right of x=0, f(x)=2
range = $(-\infty,0)\cup\{2\}$