How to prove the function $f$ has an antiderivative? There is a question in our analysis book and I have lots of problem with it. It says that:
set
$$
f(x)= \begin{cases}
 0 \quad & x\leq0\\
 \sin(\frac{\pi}{x}) \quad & x>0
 \end{cases}
$$
$$
g(x)=
 \begin{cases}
 0 \quad & x\leq0\\
 1 \quad & x>0.
 \end{cases}
$$
prove that $f$ has an antiderivative but $g$ does not.
My first problem is about antiderivative of $g$. I think it has an antiderivative and it is
\begin{align*}
G(x)=&\left\{
 \begin{array}{ll}
 0 \quad & x\leq0\\
 x \quad & x>0.
 \end{array}
\right.
\end{align*}
Why we can't say that $G$ is antiderivative of $g$? My second problem is about finding the antiderivative of $f$. As you may know antiderivative of $\sin(\frac{\pi}{x})$ can not be shown by the elementary functions. So, to prove that $f$ has antiderivative I can't find a function like $F$ which its derivative is $f$ and I need to use another approach to prove it, but I don't have any idea about what should I do?

For $f(x)$, use the Taylor expansion of sine about zero to express $$\sin \left( \frac{\pi}{x} \right)$$ as an infinite sum. From there, integrate across the sum to give a function for the antiderivative. 
As for your expression for $G$, the problem is that $g$ is not defined at zero. Given that an antiderivative, by definition, has a derivative, we can say that $g$ has no antiderivative.
