Look at where the red line crosses/ touches the X axis. This will give you the zeros.
It crosses at -1, it touches at 1 and crosses again at 3
This means the zeros are -1, 1 and 3
So you now you need to have (x+1) (x-3) and (x-1) as factors.
This makes the answer: f(x) = (x − 1)2(x + 1)(x − 3)