Answer
$$y=2\cos \frac{\pi x}{2}$$
Work Step by Step
Looking at the graph, we find that this is the graph of a cosine function with amplitude $2$ and period $4$. So, we conclude that$$A=2, \quad B=\frac{2\pi }{4 }=\frac{\pi }{2} \\ \Rightarrow \quad y=A \cos Bx = 2 \cos \frac{\pi x }{2}.$$