$f(x)$ is defined $\forall x \geq 0$ and has a continuous derivative. It satisfies $f(0)=1,f'(0)=0$ and $(1+f(x))f''(x)=1+x$ Prove that $f(1) \leq \frac{4}{3}$.
Given solution (which I didn't understand):
$1+x$ is never $0$, so $1+f(x)$ is never $0$. As $f(0)=1$, it is always positive. Hence also $f''(x)$ is always positive. As $f'(0)=0$, this gives $f'(x)>0, \forall x>0$. Hence in particular $1+f(x) \geq 2 \implies f''(x) \leq \frac{1+x}{2}$. Integrating gives $f'(x) \leq f'(0) + \frac{x}{2}+\frac{x^2}{4} = \frac{x}{2}+\frac{x^2}{4}$. Integrating again gives $f(x) \leq f(0)+\frac{x^2}{4}+\frac{x^3}{12}$. Hence $f(1) \leq 1+1/4+1/12=4/3$.
I failed to see why $f(x)$ must always be positive. I can understand the rest of the solution apart from this. I am also unable to understand the situation by considering some functions as examples, as I'm unable to think of any elementary function which satisfies the given conditions.
Consider $(1+f(x))f''(x)=1+x$ for $x\geq 0$. Since the right hand side is strictly positive ($1+x\geq 1$), the left hand side must be as well. This means, for all $x$, either
(i) $1+f(x)<0$ and $f''(x)<0$ or
(ii) $1+f(x)>0$ and $f''(x)>0$
By continuity of $f(x)$, either case (i) or (ii) must hold for all $x\geq 0$, with the other one not occurring. The fact that $f(0)=1$ guarantees that case (ii) occurs.
If case (i) were also occur, by the IVT, there must be $x_0$ such that $1+f(x_0)=0$. But then this implies $1+x_0=0$, a contradiction.
Thus, $f''(x)>0$ for all $x.$ This fact shows $f'(x)>0$, for if $f'(x_1)\leq 0$ for some $x_1$, then since $f'(0)=0$, by the MVT, this means there is some $c \in (0,x_1)$ such that $f''(c)\leq 0$, a contradiction.
Hence, we conclude that $f''(x)>0$ and $f'(x)>0$ for all $x$.