Prox Operator of the Projection to $\mathbb{R}_{+} $ Part 001 
Given $  f \left( x \right) = {x}_{+} $.
What would be $ \displaystyle \operatorname{Prox}_{f} \left( x \right) = \operatorname*{argmin}_u \left\{ f \left( u \right) + \frac 1 2 {\left\| u - x \right\|}^{2} \right\} $?
Part 002
Now, assuming $ x \in {\mathbb{R}}^{n} $ and $ e \in {\mathbb{R}}^{n} $ where $ e = {\left[ 1, 1, \ldots, 1 \right]}^{T} $.
Defining $ g \left( x \right) = {e}^{T} {x}_{+} $.
What would be $ \displaystyle \operatorname{Prox}_{g} \left( x \right) = \operatorname*{argmin}_u \left\{ g \left( u \right) + \frac 1 2 {\left\| u - x \right\|}^{2} \right\} $?
Thank You.
 A: Part 001
If one assume $ u $ is positive, the answer is $ u = x - 1 $ as a minimization of $ u + \frac{1}{2} {\left\| u - x \right\|}^{2} $.
Hence for any $ x \geq 1 $ the answe is $ u = x - 1 $.
For $ x < 0 $ the answer is $ u = x $ since then the cost is zero and this is a non negative cost function.
For $ 0 < x < 1 $ the answer is $ u = 0 $ as $ u $ can't be positive and making it less than zero will gain nothing for the term $ {u}_{+} $ and yet will add for the quadratic term.
Part 002
Same idea means:
$$ {u}_{i} = \begin{cases}
{x}_{i} - 1 & \text{ if } {x}_{i} > 1 \\ 
0 & \text{ if } 0 \leq {x}_{i} \leq 1 \\ 
{x}_{i} & \text{ if } {x}_{i} < 0
\end{cases} $$
Both results can be verified using the identity:
$$ x - u \in \partial f \left( u \right), \; u = \displaystyle \operatorname{Prox}_{f} \left( x \right) $$
Where the Sub Gradient of each is given by:
$$ c = \begin{cases}
0 & \text{ if } x \leq 0 \\ 
1 & \text{ if } 0 < x
\end{cases} \in \partial f \left( x \right) , \quad d \in \partial g \left( x \right) \; \text{s .t. } \; {d}_{i} = \begin{cases}
0 & \text{ if } {x}_{i} \leq 0 \\ 
1 & \text{ if } 0 < {x}_{i}
\end{cases} $$
Pay attention that in Part 001 the function is a scalar function.
Michael Grant,
I saw you answered as well (While I was typing).
Since you were first, please bring your answer back so I will be able to mark it.
Thank You.
