Your equation: $\text {initial momentum = final momentum}$, applies only to the total momentum. It does not apply to individual masses separately.
Here the initial momentum of the mass $m = \text {initial total momentum} = mv$ (since the wall is not moving)
The final total momentum is the sum of the momenta of the wall and the momentum of the mass $m$
The final total momentum is thus the initial total momentum = $mv = -mv + x$
Change in the momentum of $m = -mv-mv =-2mv$.
Change in the momentum of the wall $= + 2mv$.
Total change in the momentum of the system $= (-2mv + 2mv) = 0$ (by law of conservation of momentum). You may add the units to the quantities.
Comment: The diagram shows the velocity after collision as $-v \:\mathrm{ms^{-1}}$ with an arrow pointing to the left. That would be incorrect. $-mv$ with arrow pointing to the right or $mv$ with arrow pointing to the left would be correct.