Euler central differences method $$
\frac{\partial y}{\partial t} + c\frac{\partial y}{\partial x} = 0,$$ $$y = cos(x), t=0,$$$$\frac{\partial y}{\partial t}=csin(x), t=0  $$
has a solution $$y=cos(x−ct).$$
I wanted to expand both the derivatives as centered differences. So, in order to expand my derivatives, I did as shown below;
$$\frac{y(i+1) - y(i-1)}{2Δt} +c(\frac{y(i+1) - y(i-1)}{2Δx}) = 0$$
$$\frac{y}{Δt} +c(\frac{y}{Δx})= 0$$
Now, I also intend to prove that the algebraic solution is an exact solution of the difference formula if I choose $Δx=cΔt$. How do I achieve this goal?
 A: Some hints:
Your time-discretization in your update to your post is not right.  Please note how I have indicated it in the comment above - there are 2 indices, one (subscript i) indicates the x dimension and the other (superscript n) indicates the time dimension.  Your teacher should have taught you this.  Anyway, look at equation 29 on this linked doc. For this problem, you don't even need to think about indexes, just that you are representing $\frac{\partial y(t,x)}{ \partial x}$ as $\frac{y(t, x+\Delta x)-y(t, x-\Delta x)}{2 \Delta x}$.  Similarly for $\frac{\partial y(t,x)}{ \partial t}$ in terms of $\Delta t$
Now, to show the $y=\cos(x-ct)$ satisfies the equation when the "grid speed" $\frac{\Delta x}{ \Delta t}$ equals the wave speed $c$, just plug in $y=\cos(x-ct)$ into the discretized equation you just created. 
You will need the trigonometric identity
$$\cos(x)−\cos(y)=−2\sin(\frac{x+y}{2})\sin(\frac{x-y}{2})$$
And indeed, when grid speed equals wave speed, the LHS of the discretized equation, then evaluates to zero, which is the RHS.
