First we can find the value of b, which is the y-intercept of the function.
Using the point (0, 2), we have that:
[tex]\begin{gathered} y=a|x|+b \\ \\ 2=a\cdot0+b \\ b=2 \end{gathered}[/tex]Now, in order to find the value of 'a', we can use the point (2, -2):
[tex]\begin{gathered} -2=a|2|+b \\ -2=2a+2 \\ 2a=-4 \\ a=-2 \end{gathered}[/tex]So the values of 'a' and 'b' are a = -2 and b = 2.