The give problem is NOT a function.
A relation is any set of ordered pairs, which can be thought of as (input, output).
A function is a relation in which no two ordered pairs have the same input and different outputs. Thus, a function can only take on one output for each input.
In the given problem, q has two output values: y and z. Therefore, the given relation is not a function.