But the focal length of convex mirror is given positive but in some problems we take it as positive. Why?
Under the rules of sign convention the focal length of a convex mirror will always be taken as a positive. This is because the focal point is formed on the right side of the mirror (or the positive x-axis).