A simple way to find out if it is a hardware or software problem is to switch to the French keyboard setting in the International Preference Pane.
The "Z" will then appear under your "W" key and the "W" will appear under the "Z" key.
If it is a hardware problem, then you will still be able to use the "Z" while in the American keyboard setting after having typed and copied it while in the French keyboard setting.
You can then paste the "Z" whenever you wish. It is not an ideal solution, but you can nevertheless have your work done until you get your keyboard fixed.
And if you have PopChar installed, you can easily get your "Z" through it for the time being.
BimBam