I have a Canon 500D with the kit lens. Recently I have observed that its not able to focus at higher zooms but it works at min zoom. To get it to focus, I have to zoom out or recompose and it works. Why would this happen?
If this is the f/3.5-5.6 lens, then as you zoom out the max aperture is reduced ( f/3.5 at 18mm, but f/5.6 at 55mm). Autofocus will struggle in lower light at the f/5.6 end.
You can try to find something high contrast to focus on, or use manual focus if you have to.
If you focus at 18mm then lock focus and zoom in, that won't necessarily still be in perfect focus at 55mm.
It sounds as though one of the autofocus cables inside the lens is about to fail - this is a very common problem on the kit lens and the initial problem is failure to autofocus at certain zoom settings followed by complete failure to autofocus in one direction once the cable has totally broken. It is a ribbon cable and replacements can be found on ebay for about two dollars. However the fitting of it isn't easy. You have to take the lens apart and would need tweezers, glue (possibly) and watchmaker's screwdrivers. Alternatively camera shops repair them for around $100