hey i have to find SG function for a subtraction game where we can take 1,3,4 chips. I found this function: $g(x)= \begin{cases} 0, x \equiv 0 (\mod7) \vee x\equiv 2(\mod 7) \\ 1, x \equiv 1 (\mod7) \vee x\equiv 3(\mod 7)\\ 2, x \equiv 4 (\mod7) \vee x\equiv 6(\mod 7)\\3, x \equiv 5 (\mod7) \end{cases} $
But I have no idea how to prove it by induction.
You’ve already done all the real work; the proof by induction is now just a formality:
Assuming that you intended to imply normal play (as opposed to misère play), the pile of $0$ has value $0$. The pile of $1$ can only reach $0$ so the value is $\def\mex{\operatorname{mex}}\mex(0)=1$. The pile of $2$ can only reach $1$, so the value is $\mex(1)=0$. The pile of $3$ can reach $0$ or $2$, so the value is $\mex(0,0)=1$.
Those are the base cases for the induction. Now assume that your function is correct for all $y\lt x$, and go through the cases:
If $x\equiv0\bmod7$, then you can reach $y\equiv3$, $4$ or $6\bmod7$, so the value is $\mex(1,2,2)=0$.
If $x\equiv1\bmod7$, then you can reach $y\equiv4$, $5$ or $0\bmod7$, so the value is $\mex(2,3,0)=1$.
If $x\equiv2\bmod7$, then you can reach $y\equiv5$, $6$ or $1\bmod7$, so the value is $\mex(3,2,1)=0$.
If $x\equiv3\bmod7$, then you can reach $y\equiv6$, $0$ or $2\bmod7$, so the value is $\mex(2,0,2)=1$.
And so on.