With the help of recursion tree we can easily find the function value for some small numbers.
$\begin{align*} &\text{foo}(0) = 1 \\ &\text{foo}(1) = 1 \\ &\text{foo}(2) = 2 \\ &\text{foo}(3) = 4 \\ &\text{foo}(4) = 8 \\ &\text{foo}(5) = 16 \\ &\text{foo}(6) = 32 \\ \end{align*}$
We can see that, for $n > 0$ $ \;\;\;\; \text{foo}(n) = 2^{n-1} $
Therefore $\text{foo}(10) = 512$