Think about it this way. The range of f(x) is $-2 \leq y \leq 6$ and you want to move and squeeze this to fit into $0\leq y \leq 1$

One way to do this is to move it so that the endpoints of one side coincide, and then to squeeze it so that the other ones do.

So we'd move f(x) to have range $0\leq y \leq 4$ and then we'd squeeze it to have range $0 \leq y \leq 1$

We move it by adding D. We squeeze it by multiplying by A.

Do you think you can find D and A now?