The approach you tried doesn't work because f is evaluated before the replacement rule is applied.
An approach like the following certainly works:
a = 1;
fResult = f;
But that's probably too ornate for whatever you are doing given that you don't want to define an
Another approach is to define f as
f[x_] := x^2
and then to execute
If[a > 0, f] /. a -> 1
If[a > 0, f,alternative] /. a -> 1
I'm sure there are lots of approaches, but which one you might use depends on the particular problem that you are coding.