On f(R) gravity in scalar-tensor theories