Show that $f$ is the zero function if $f''(x)=f(x)$ and $f(0)=f'(0)=0$

Because $f'' = f$ on $\mathbb R,$ we see that $f\in C^2(\mathbb R).$ Let $M= \sup_{[0,1]}|f|.$ Then $M=|f(x_0)|$ for some $x_0 \in [0,1].$ By Taylor, there is $c\in (0,x_0)$ such that

$$f(x_0) = f(0) + f'(0)x_0 + f''(c)x_0^2/2 = f''(c)x_0^2/2 = f(c)x_0^2/2.$$

Taking absolute values then gives $M\le Mx_0^2/2 \le M/2.$ That implies $M=0.$ Thus $f\equiv 0$ on $[0,1].$ This argument can be continued to the right to give $f\equiv 0$ on $[0,\infty).$ The argument also works to the left, so we have $f\equiv 0$ on $\mathbb R$ as desired.


Suppose $f''=f$ and consider $g(x)=(f'(x)+f(x))e^{-x}$. Then $$ g'(x)=(f''(x)+f'(x))e^{-x}-(f'(x)+f(x))e^{-x}=0 $$ Therefore $g(x)$ is constant. Since $$ g(0)=0 $$ we have $f'(x)+f(x)=0$, for every $x$. Therefore $f'=-f$. Consider $$ h(x)=f(x)e^{x} $$ Then $h'(x)=f'(x)e^x+f(x)e^x=0$ so also $h$ is constant. Since $h(0)=0$, we are done.


For a real function the fact that the Taylor series is $0$ to any order does not mean the function is $0$; the well known example is

$$f(x)=\begin{cases} e^{-1\over x^2}&x\neq 0\\0&x=0\end{cases}$$

One can check it is infinitely derivable at $0$ with $\forall n,\,f^{(n)}(0)=0$.

No to solve your problem you need to use unicity theorems related to ODE (e.g Cauchy Lipschitz) or equivalently knowing that the solution of a linear second order ODE is uniquely determined by two parameters ($y(0)$ and $y'(0)$) and noticing that the zero function verifies the $y''+y=0$, $y(0)=0$ and $y'(0)=0$ and so is the unique solution.