Q:

when should I override Equals function?

Possible Duplicate:
Java: Always override equals? 

should I override equals function for any class that I create? 
even for very simple classes which only contains some very simple attributes and by equals  I need every single attribute of it to be equal?

A:

should I override equals function for any class that I create?

Override equals if (and only if) the object "represents some data", i.e. if it models something such as Person, Car or RecipieIngredient (these typically end up in collections etc). Don't override equals for other types of classes, for example LoginServlet or DatabaseUtil.
Remember to always override hashCode whenever you override equals.

(A natural follow-up question:) What happens if I don't override equals and hashCode?

Any two objects will be considered unequal unless they are the exact same object.

[...] I need every single attribute of it to be equal?

Typically yes. It depends on how you define your notion of equality. Note that for reference types, you can reuse/delegate to that objects implementation of equals (and hashCode) when implementing your own.
Related questions:

why we need to override equals and hashcode in java and why cannot we use Object class implementation
Why do I need to override the equals and hashCode methods in Java?

A:

You should only override equals() if you have a reason to do so. As described here, it is very difficult to write a proper equals() method for non-final or mutable classes.
If your application requires some sort of equality concept that is different from "the identical object", then by all means go ahead. Just read the above reference to be aware of what's involved. But as a matter of routine? Definitely not.

