After creating a "Credit Memo", how to ensure whether the user has created "Credit Memo" with online or offline ?
First of all whether a credit memo can be done online depends on the payment methods used for that order. Note that online means that a payment gateway was involved during the payment process. If a online payment method was used you the button named "refund" will create a online refund and the second button named "refund offline" will create an offline refund. If no online payment method was used (or the payment gateway does not support online refunds) the "refund offline" button will create an offline refund. For further information please refer to: http://merch.docs.magento.com/ce/user_guide/order-processing/credit-memo-create.html
As luemic said, the Online refund is enabled by the payment gateway, and Magento doesn't store this information.
What you could do instead is checking the transactions on the gateway itself, for example if you are using SagePay you have the table
sagepaysuite_action, search for parent_id which is the Order ID, and action_code
If you can't see anything there, that means the refund has been made Offline.