You can't replace $\tilde s_j$ by $\int_{-\infty}^{+\infty} s(t)\cdot f_j^*(t) \mathrm{d}t$, because that is what you want to prove.
Let us start from the beginning, the equation $s(t) = \sum_{j=1}^N \tilde s_j\cdot f_j(t)$.
For $1\leq i\leq N$, let us take the inner-product on the right with $f_i$ in the previous equality, which yields $\langle s \mid f_i\rangle = \langle \sum_{j=1}^N \tilde s_j\cdot f_j \mid f_i\rangle$ and by linearity of the inner-product $(\star)$, one has $\langle s\mid f_i\rangle = \sum_{j=1}^N \tilde s_j\cdot \langle f_j\mid f_i\rangle$, and since the family of the $f_k$'s is an orthonormal family, this sum simplifies to $\tilde s_i$.
By definition, the left-hand side of the equality is $\langle s\mid f_i\rangle = \int_{-\infty}^{+\infty} s(t)f^*_i(t)\mathrm{d}t$, so that overall we have $\tilde s_i = \int_{-\infty}^{+\infty} s(t)f^*_i(t)\mathrm{d}t$, as required.
Note that nothing "special" happens because we deal with functions. It is true in every inner-product space: if $x = \sum x_ib_i$ where $\{b_1,\ldots,b_N\}$ is an orthonormal family, then $x_i = \langle x \mid b_i\rangle$, where $\langle\cdot\mid\cdot\rangle$ is the inner-product.
PS: Linearity is the following property:
$(\star) \forall x_1,x_2,y\in V, \forall \alpha,\beta\in K, \langle \alpha x_1+\beta x_2\mid y\rangle = \alpha\langle x_1\mid y\rangle + \beta\langle x_2\mid y\rangle$ where $V$ is a $K$-vector space.
You can't replace $\tilde s_j$ by $\int_{-\infty}^{+\infty} s(t)\cdot f_j^*(t) \mathrm{d}t$, because that is what you want to prove.
Let us start from the beginning, the equation $s(t) = \sum_{j=1}^N \tilde s_j\cdot f_j(t)$. For $1\leq i\leq N$, let us take the inner-product on the right with $f_i$ in the previous equality, which yields $\langle s \mid f_i\rangle = \langle \sum_{j=1}^N \tilde s_j\cdot f_j \mid f_i\rangle$ and by linearity of the inner-product $(\star)$, one has $\langle s\mid f_i\rangle = \sum_{j=1}^N \tilde s_j\cdot \langle f_j\mid f_i\rangle$, and since the family of the $f_k$'s is an orthonormal family, this sum simplifies to $\tilde s_i$.
By definition, the left-hand side of the equality is $\langle s\mid f_i\rangle = \int_{-\infty}^{+\infty} s(t)f^*_i(t)\mathrm{d}t$, so that overall we have $\tilde s_i = \int_{-\infty}^{+\infty} s(t)f^*_i(t)\mathrm{d}t$, as required.
Note that nothing "special" happens because we deal with functions. It is true in every inner-product space: if $x = \sum x_ib_i$ where $\{b_1,\ldots,b_N\}$ is an orthonormal family, then $x_i = \langle x \mid b_i\rangle$, where $\langle\cdot\mid\cdot\rangle$ is the inner-product.
PS: Linearity is the following property: $(\star) \forall x_1,x_2,y\in V, \forall \alpha,\beta\in K, \langle \alpha x_1+\beta x_2\mid y\rangle = \alpha\langle x_1\mid y\rangle + \beta\langle x_2\mid y\rangle$ where $V$ is a $K$-vector space.