Interfacing an inductive proximity sensor with the Pin RA0 of PIC16F690
I get nervous when I see 5&nbsp;V logic mixed up with 24&nbsp;V supply but you seem to have got away without smoke. Putting together your bits of circuitry I think you might have this:







simulate this circuit &ndash; Schematic created using CircuitLab

It's possible that the collector base junction is forward biased and has a low enough resistance to ground to pull RA0 low while the prox switch driver circuit powers up. You could test this fairly easily by disconnecting the 24 V, powering up and measuring the voltage on the black wire (with the pull-up connected).

The danger with your setup is that 


the switch could have an internal pull-up which, when Q1 is off, would pull RA0 to +24&nbsp;V. (It didn't, so it doesn't.)
If the blue wire is disconnected you could get enough current leaking from the 24&nbsp;V through the electronics and through the base-collector junction. This would pull RA0 above +5&nbsp;V.


Either of the above scenarios would smoke your PIC. Better to use an opto-isolator. Kimliv asked a question about the same switch a year ago. You may find some help there.