Can this "formal proof" of irrationality of $\pi$ be made rigorous? Suppose that $\pi=\frac{p}{q}$ for natural numbers $p$ and $q$.
Let $g_n(x)=\sin(x^n)$ for $n\in \mathbb{N}$. Observe that, all the functions $g_n(x)$ vanish at $x=p$ as $x^n=p^n=p^{n-1}q \pi$ for all $n\in \mathbb{N}$ are integral multiples of $\pi$.
Now we consider $$f(x)=\sum_{n=1}^{\infty}a_n\sin x^n=\sum_{n=1}^{\infty}a_n g_n(x)$$ where $a_n$ is the Dirichlet's inverse of $\frac{(-1)^{\frac{n-1}{2}}}{n!}1_A(n)$, $A$ is the set of odd numbers, and $1_A(n)$ is the indicator function of $A$. These specific $a_n$ are chosen so that "formally" when we expand $f(x)$ using Taylor series expansion of $\sin x^n$ we get $f(x)=x$. 
If we plug in $x=p$ in $\sum_{n=1}^{\infty}a_n g_n(x)=x$ we get the left hand side to be $0$ and right hand side is $p$, which is a contradiction. 
The problem with this proof is with the assumption $f(x)=x$, as merely showing that the Taylor series expansion to be $x$ does not make $f(x)$ equal to $x$. Can someone make this proof rigorous by showing that their exists a linear combination of $g_n(x)$ which does not vanish at $x=p$?
 A: I will show $\sin(p) \neq 0$ for $p$ integer, which proves $\pi$ is irrational as you have outlined above. To do this, I will show that $\sin(p)$ irrational, adapting the method for showing $e$ irrational! If you're not familiar with it, look at Fourier's proof here https://en.wikipedia.org/wiki/Proof_that_e_is_irrational.
Suppose $\sin(p)=a/b$; then $\displaystyle \frac{(bp)!\sin(p)}{p^{pb}}$ is an integer. 
$\displaystyle \sin(p)=-\sum_{n=1}^\infty \frac{(-p)^{2n-1}}{(2n-1)!}$. Hence, 
$\displaystyle \frac{(bp)!\sin(p)}{p^{pb}}=\mathrm{integer}-\sum_{n\geq bp, \ n\ \mathrm{odd}} \frac{(-p)^{n-bp}(bp)!}{n!}$.
As in the proof for $e$, the sum of the absolute values are bounded between $0$ and $1$, $0<\displaystyle \sum_{n\geq bp, \ n\ \mathrm{odd}} \frac{p^{n-bp}(bp)!}{n!}<1$.
Moreover, this being an alternating series with strictly decreasing terms that is absolutely convergent, we can pair consecutive terms up to see the result will be strictly positive or strictly negative. Hence if $x=\displaystyle \sum_{n\geq bp, \ n\ \mathrm{odd}} \frac{(-p)^{n-bp}(bp)!}{n!}$, must have $-1<x<0$ or $0<x<1$, a contradiction to our assumption that $\sin(p)$ is rational.
Hence $\sin(p)$ irrational and consequently non-zero, proving our claim.

Addendum: to produce a contradiction as you want (a linear combination of $g_n$ which does not vanish at $x=p$), we must equivalently show that $\ \sin(p^n) \neq 0$ for some $n$. 
But since $\cos(kp)=\pm 1$ (WLOG take $\cos(p)=1$, by doubling $p$ and $q$), $\sin(p^2)=\sin(p^2-p+p)=\sin(p^2-p)\cos(p)+\sin(p)\cos(p^2-p)=\sin(p^2-p)+\sin(p)$, 
so, repeating this,
$\sin(p^2)=p\sin(p)$ 
and 
$\sin(p^n)=p^{n-1}\sin(p)$.
So equivalently we must prove $\sin(p) \neq 0$ directly for integer $p$ (divisible by $2$).
