How to know if a material is an anode or cathode? and if i connect an anode and a cathode will it be a diode? Like the pensil razor diode, if it worked not because of that, how does it work?
The anode is the terminal where conventional current enters a device. The cathode is the terminal where current exits the device. These definitions make no reference to the material the terminals are made of whatsoever. So a material used as the anode in one device might be used for the cathode in another. But of course there are properties that determine which materials are appropriate for use as anode or cathode in any particular type of device.
In the case of the razor-blade diode, the operation is similar to a Schottky diode with the bluing on the razor blade being the semiconductor material. As in other solid state diodes (such as the pn-junction diode), the anode is the material with the higher chemical potential (relative to vacuum potential) and the cathode is the material with lower chemical potential.