I would like to know if a step function $f$ exists on $\mathbb{R^+}$ such that for $k \in \mathbb{N}$,
$$f(0)=1$$ $$f(1)=0$$ $$f(2k) = (-1)^k$$ $$f(2k+1) = 0$$
Where $f(x) \not= \cos\bigl(\frac{\pi x}{2}\bigr)$
If so, I would appreciate a specific example of such a function that can be expressed in standard mathematical notation. I would also not like anything in forms of trigonometric functions.
As per the conditions : f(1) cannot be defined. Do you need functions f(x) that satisfy the above conditions and are undefined for x=1 ?