But you or the book forgot to say that dA/dt = 0

Neither I nor the book forgot to say that since that's what is to be shown, i.e. the problem reads

For a free particle moving in one dimension, show that

A = x - pt/m

satisfies the equation

@A/@t = -{A, H}

so that it is a constant of the motion.

I see that I didn't state the problem completely. The particle is free and therefore dp/dt = 0.

In the problem before that I showed that

dA/dt = @A/@t + {A, H}

Therefore the problem tells us to show that A = x - pt/m satisfies @A/@t = -{A, H} so that dA/dt = 0 and therefore A = constant. Your response is not the answer because you assumed that which was to be proven.

I know how to solve it now

A = x - pt/m

@A/@t = -p/m = -v = -dx/dt

@A/@p = t/m

@A/@x = 1

Hamilton's equations

@H/@x = -dp/dt = 0

@H/@p = dx/dt

{A, H} = (@A/@x) (@H/@p) - (@H/@x) (@A/@p)

{A, H} = dx/dt - (-dp/dt) (t/m) = dx/dt = -@A/@t

i.e.

@A/@t = -{A, H} QED!!