How can I 'bridge' and unbridge connections between two inputs
If you mean a non mechanical switch, then you need a multiplexer.  

Something like this for an analog signal should do.
To use the above, you just connect either side to Y and Z - they are like the switch terminals through which the signal passes (or not), your supply voltage to  Vcc, ground to GND. To switch you toggle the E input, which switches the "switch" on or off. 



EDIT - here is another more expensive example part. This has a maximum ON resistance of 0.9 ohm (as opposed to up to 100 ohms for the cheaper part) 200MHz bandwidth and can handle up to 500mA.
It is used in a similar manner to that described for the other part.

This part below is now not relevant to the question but I'll leave it here for future reference.
If the signal is digital either the above or a tristate buffer gate could be used. If the signal doesn't go anywhere else you could just tristate the microcontroller pin.
For example you may not need this if your signal from I/O 23 does not go to anything else apart from I/O 22 (does it?) If this is the case why don't you just switch I/O 23 to high impedance (i.e. input) when you don't need it?  
If I/O 23 drives something else as well as I/O 22, or the signal is coming from somewhere else and both pins are inputs then you probably need the multiplexer.