1) what material and diameter is that pipe?
2) Cut the pipes just hehind the caps and solder your angle valves (usually, R19 chrome stops) to the petruding tubing
3) You can use any type of screws and anchors to attach the brackets to the wall. Typically, it would have been wise to put a wood backing during the roughin stage at the approx. height of where the screws or lag bolts would have to go. (General rule of thumb, 30" from floor to center of 2x8 backing)