Ok here's a riddle. :) So there are three pipes coming out of this wall to what used to be a gas water heater. The one on the right is the cold water, the one on the left will pour cold water if the sink has both cold and hot water valves turned on but will immediately stop if either the cold OR the hot is turnyed off. What is this pipe? I am assuming the right pipes are cold in and hot out. Can the left pipe just be capped off? Does it need to go back to the hot? Thanks!
Here's my guess. The left pipe goes to the hot water faucet of a fixture with a common hot+cold spout. Since there is no hot water pressure at that faucet, when you open both faucets some of the cold water comes out the spout and some flows backward through the hot water faucet and spills out the left pipe.
The left pipe may also connect to the hot faucets of some other sinks. The center pipe may connect to other hot faucets, or it may be a drain.
If you can't trace the pipes inside the walls, you will need to force something to flow through the pipes so you can find where it comes out. The simplest thing to use would be water from a garden hose, or a hose temporarily connected to the cold water supply in your photo. Trim and smooth the ends of the pipes and use a flexible coupling to attach the hose.