We have 2 crossings at x=3 and x=-2. Then, the factors (x-3) and (x+2) have degree one. On the other hand, since the function bounces off at x=5, the exponent of the factor (x-5) has to be even. So, we can write our function as
where A is the leading coefficient and n is a even number: 2, 4, 6, 8, .... etc.