I need to have a 12v battery attached to the arduino for constant running of arduino, but the problem is the charger that will charge the battery. Yes, there are a million ups systems for that but it will be expensive for just one arduino based system so i was thinking will it work it i connect the arduino to the battery terminal and also connect some automatic 12v battery charger with it too at the same time? It will charge the battery when it's low and also arduino will start getting the power from the battery (if there is power failure)
Yes you can probably do that and basically that's how most (non professional) UPSs work as well. They consist of a Lead-Acid battery, a charger which charges that battery continuously, an inverter (to make mains voltage from 12V) and some control circuit to switch to the power from the inverter when the mains is off line.
If you're using a Lead-Acid battery then it is OK to charge it continuously. The charging will stop or switch to a very small charging current when the battery is full. As a Lead-Acid battery charges its voltage will rise and at about 13.8 - 14 V it is full. As most chargers supply not more than 14 V charging will stop by itself.
If you do not have a charger yet I suggest to select one with a low charging current as that will save power. Initial charging (when the battery is empty) will take long but as the system will mainly be mains powered, that isn't an issue.
Then indeed just supply the Arduino directly from the battery and you're done.