Answer: No, the friend is correct. In any function, each input value can only lead to one output value. When you input 3 for the x-values, you would get two output values because 3 is included in both equations. To fix this, you need to have the 3 not included in one of the equations.
For example, you could say
or
because the input value of 3 would not be included twice.
If you look at the attached screenshot, you will see that if you keep your friend's function, inputting 3 will result in two outputs of 4 and -3, so therefore,
cannot represent a piecewise function.