how to find a function f(n) (continuous on R) such that $(-1)^{f(n)}$ is positive when n=1, 2, 5, 6, 9, 10…., and negative for other natural number?

Further more, can we have a general way to find f(n) which is negative whenever we design?(note: we just take n as natural number)

I think some function with sin, cos will satisfy this.