How do I know if the broker or sub broker is registered?

You can confirm it by verifying the registration certificate issued by SEBI. A broker's registration number begins with the letters "INB" and that of a sub broker with the letters "INS". For the brokers of derivatives segment, the registration number begins with the letters "INF". There is no sub-broker in the derivatives segment.